Jump to content

Gift Certificate Form to Long


jweatherby1983

Recommended Posts

I have this form that is far to long. I need to set it up in 3 pages. One page about the person getting the Gift Certificate, one for the person purchasing the certificate and another for credit card information.  I have read about hidden variable but am a noobie.  Any thoughts would be greatly appreciated.

 

[attachment deleted by admin]

Link to comment
Share on other sites

Your first step would probably be to make each section of the form its' own html table so that you can wrap each one in the <fieldset></fieldset> tags -

<fieldset class="sectionwrap">
<legend>Your heading here</legend>

one section of your form here...

</fieldset>

 

And your dark background (222222) makes your form almost unreadable. I used 777777 just so that I could see what your page is doing.

Link to comment
Share on other sites

Here is your page modified to use that script -

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="formwizard.css" />
<script src="formwizard.js" type="text/javascript">
/***********************************************
* jQuery Form to Form Wizard- (c) Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
</script>
<script type="text/javascript">
var myform=new formtowizard({
formid: 'feedbackform',
persistsection: true,
revealfx: ['slide', 500]
})
</script>

<title>Akari &#8212; Wellness &#9830; Beauty &#9830; Style &#9830; Gift Certificate Order Page</title>
<?php include("includes/head.html"); ?>
</head>
<body>
<div id="social" align="right"><a href="http://twitter.com/AkariPortlandME" ><img src="../images/twitter.png" alt="Akari Twitter" width="32" height="32" border="0" /></a><a href="http://www.facebook.com/pages/Portland-ME/Akari/144118729219" ><img src="../images/facebook.png" alt="Akari Facebook" width="32" height="32" border="0" /></a> </div>
<div id="container">

<div id="header">
</div>

<div id="navbar">
<?php include("includes/navbar.html"); ?>
</div>

<div id="mainContent" style="overflow:auto;background-color:#777777;">
<div style="margin:20px">
<?php

error_reporting(E_ALL & ~E_NOTICE);
ini_set('display_errors', true);
require './ccvs.inc';
require './HOP.php';

function error_bool($error, $field) {
if($error[$field]) {
	print("<td style=color:red>");
}	else {
	print("<td>");
}
}

function countryArray(){
$countries = array(
'US'=>'United States',
'AF'=>'Afghanistan',
'AX'=>'Aland Islands',
'AL'=>'Albania',
'DZ'=>'Algeria',
'AS'=>'American Samoa',
'AD'=>'Andorra',
'AO'=>'Angola',
'AI'=>'Anguilla',
'AQ'=>'Antarctica',
'AG'=>'Antigua And Barbuda',
'AR'=>'Argentina',
'AM'=>'Armenia',
'AW'=>'Aruba',
'AU'=>'Australia',
'AT'=>'Austria',
'AZ'=>'Azerbaijan',
'BS'=>'Bahamas',
'BH'=>'Bahrain',
'BD'=>'Bangladesh',
'BB'=>'Barbados',
'BY'=>'Belarus',
'BE'=>'Belgium',
'BZ'=>'Belize',
'BJ'=>'Benin',
'BM'=>'Bermuda',
'BT'=>'Bhutan',
'BO'=>'Bolivia, Plurinational State Of',
'BA'=>'Bosnia And Herzegovina',
'BW'=>'Botswana',
'BV'=>'Bouvet Island',
'BR'=>'Brazil',
'IO'=>'British Indian Ocean Territory',
'BN'=>'Brunei Darussalam',
'BG'=>'Bulgaria',
'BF'=>'Burkina Faso',
'BI'=>'Burundi',
'KH'=>'Cambodia',
'CM'=>'Cameroon',
'CA'=>'Canada',
'CV'=>'Cape Verde',
'KY'=>'Cayman Islands',
'CF'=>'Central African Republic',
'TD'=>'Chad',
'CL'=>'Chile',
'CN'=>'China',
'CX'=>'Christmas Island',
'CC'=>'Cocos (Keeling) Islands',
'CO'=>'Colombia',
'KM'=>'Comoros',
'CG'=>'Congo',
'CD'=>'Congo, The Democratic Republic Of The',
'CK'=>'Cook Islands',
'CR'=>'Costa Rica',
'CI'=>'Cote D\'Ivoire',
'HR'=>'Croatia',
'CU'=>'Cuba',
'CY'=>'Cyprus',
'CZ'=>'Czech Republic',
'DK'=>'Denmark',
'DJ'=>'Djibouti',
'DM'=>'Dominica',
'DO'=>'Dominican Republic',
'EC'=>'Ecuador',
'EG'=>'Egypt',
'SV'=>'El Salvador',
'GQ'=>'Equatorial Guinea',
'ER'=>'Eritrea',
'EE'=>'Estonia',
'ET'=>'Ethiopia',
'FK'=>'Falkland Islands (Malvinas)',
'FO'=>'Faroe Islands',
'FJ'=>'Fiji',
'FI'=>'Finland',
'FR'=>'France',
'GF'=>'French Guiana',
'PF'=>'French Polynesia',
'TF'=>'French Southern Territories',
'GA'=>'Gabon',
'GM'=>'Gambia',
'GE'=>'Georgia',
'DE'=>'Germany',
'GH'=>'Ghana',
'GI'=>'Gibraltar',
'GR'=>'Greece',
'GL'=>'Greenland',
'GD'=>'Grenada',
'GP'=>'Guadeloupe',
'GU'=>'Guam',
'GT'=>'Guatemala',
'GG'=>'Guernsey',
'GN'=>'Guinea',
'GW'=>'Guinea-Bissau',
'GY'=>'Guyana',
'HT'=>'Haiti',
'HM'=>'Heard Island And Mcdonald Islands',
'VA'=>'Holy See (Vatican City State)',
'HN'=>'Honduras',
'HK'=>'Hong Kong',
'HU'=>'Hungary',
'IS'=>'Iceland',
'IN'=>'India',
'ID'=>'Indonesia',
'IR'=>'Iran, Islamic Republic Of',
'IQ'=>'Iraq',
'IE'=>'Ireland',
'IM'=>'Isle Of Man',
'IL'=>'Israel',
'IT'=>'Italy',
'JM'=>'Jamaica',
'JP'=>'Japan',
'JE'=>'Jersey',
'JO'=>'Jordan',
'KZ'=>'Kazakhstan',
'KE'=>'Kenya',
'KI'=>'Kiribati',
'KP'=>'Korea, Democratic People\'s Republic Of',
'KR'=>'Korea, Republic Of',
'KW'=>'Kuwait',
'KG'=>'Kyrgyzstan',
'LA'=>'Lao People\'s Democratic Republic',
'LV'=>'Latvia',
'LB'=>'Lebanon',
'LS'=>'Lesotho',
'LR'=>'Liberia',
'LY'=>'Libyan Arab Jamahiriya',
'LI'=>'Liechtenstein',
'LT'=>'Lithuania',
'LU'=>'Luxembourg',
'MO'=>'Macao',
'MK'=>'Macedonia, The Former Yugoslav Republic Of',
'MG'=>'Madagascar',
'MW'=>'Malawi',
'MY'=>'Malaysia',
'MV'=>'Maldives',
'ML'=>'Mali',
'MT'=>'Malta',
'MH'=>'Marshall Islands',
'MQ'=>'Martinique',
'MR'=>'Mauritania',
'MU'=>'Mauritius',
'YT'=>'Mayotte',
'MX'=>'Mexico',
'FM'=>'Micronesia, Federated States Of',
'MD'=>'Moldova, Republic Of',
'MC'=>'Monaco',
'MN'=>'Mongolia',
'ME'=>'Montenegro',
'MS'=>'Montserrat',
'MA'=>'Morocco',
'MZ'=>'Mozambique',
'MM'=>'Myanmar',
'NA'=>'Namibia',
'NR'=>'Nauru',
'NP'=>'Nepal',
'NL'=>'Netherlands',
'AN'=>'Netherlands Antilles',
'NC'=>'New Caledonia',
'NZ'=>'New Zealand',
'NI'=>'Nicaragua',
'NE'=>'Niger',
'NG'=>'Nigeria',
'NU'=>'Niue',
'NF'=>'Norfolk Island',
'MP'=>'Northern Mariana Islands',
'NO'=>'Norway',
'OM'=>'Oman',
'PK'=>'Pakistan',
'PW'=>'Palau',
'PS'=>'Palestinian Territory, Occupied',
'PA'=>'Panama',
'PG'=>'Papua New Guinea',
'PY'=>'Paraguay',
'PE'=>'Peru',
'PH'=>'Philippines',
'PN'=>'Pitcairn',
'PL'=>'Poland',
'PT'=>'Portugal',
'PR'=>'Puerto Rico',
'QA'=>'Qatar',
'RE'=>'Reunion',
'RO'=>'Romania',
'RU'=>'Russian Federation',
'RW'=>'Rwanda',
'BL'=>'Saint Barthelemy',
'SH'=>'Saint Helena',
'KN'=>'Saint Kitts And Nevis',
'LC'=>'Saint Lucia',
'MF'=>'Saint Martin',
'PM'=>'Saint Pierre And Miquelon',
'VC'=>'Saint Vincent And The Grenadines',
'WS'=>'Samoa',
'SM'=>'San Marino',
'ST'=>'Sao Tome And Principe',
'SA'=>'Saudi Arabia',
'SN'=>'Senegal',
'RS'=>'Serbia',
'SC'=>'Seychelles',
'SL'=>'Sierra Leone',
'SG'=>'Singapore',
'SK'=>'Slovakia',
'SI'=>'Slovenia',
'SB'=>'Solomon Islands',
'SO'=>'Somalia',
'ZA'=>'South Africa',
'GS'=>'South Georgia And The South Sandwich Islands',
'ES'=>'Spain',
'LK'=>'Sri Lanka',
'SD'=>'Sudan',
'SR'=>'Suriname',
'SJ'=>'Svalbard And Jan Mayen',
'SZ'=>'Swaziland',
'SE'=>'Sweden',
'CH'=>'Switzerland',
'SY'=>'Syrian Arab Republic',
'TW'=>'Taiwan, Province Of China',
'TJ'=>'Tajikistan',
'TZ'=>'Tanzania, United Republic Of',
'TH'=>'Thailand',
'TL'=>'Timor-Leste',
'TG'=>'Togo',
'TK'=>'Tokelau',
'TO'=>'Tonga',
'TT'=>'Trinidad And Tobago',
'TN'=>'Tunisia',
'TR'=>'Turkey',
'TM'=>'Turkmenistan',
'TC'=>'Turks And Caicos Islands',
'TV'=>'Tuvalu',
'UG'=>'Uganda',
'UA'=>'Ukraine',
'AE'=>'United Arab Emirates',
'GB'=>'United Kingdom',
'UM'=>'United States Minor Outlying Islands',
'UY'=>'Uruguay',
'UZ'=>'Uzbekistan',
'VU'=>'Vanuatu',
'VE'=>'Venezuela, Bolivarian Republic Of',
'VN'=>'Viet Nam',
'VG'=>'Virgin Islands, British',
'VI'=>'Virgin Islands, U.S.',
'WF'=>'Wallis And Futuna',
'EH'=>'Western Sahara',
'YE'=>'Yemen',
'ZM'=>'Zambia',
'ZW'=>'Zimbabwe'
);
return $countries;
}

function ccTypeArray(){
$cardnames=array(
	'001'=>'Visa',
	'002'=>'MasterCard',
	'003'=>'American Express',
	'004'=>'Discover'
	);
	return $cardnames;
}

function monthDropdown($name="month", $selected=null){
$dd = '<select name="'.$name.'" id="'.$name.'">';

$months = array(
	1 => "January",
	2 => "February",
	3 => "March",
	4 => "April",
	5 => "May",
	6 => "June",
	7 => "July",
	8 => "August",
	9 => "September",
	10 => "October",
	11 => "November",
	12 => "December");
/*** the current month ***/
$selected = is_null($selected) ? date('n', time()) : $selected;

for ($i = 1; $i <= 12; $i++)
	{
		$dd .= '<option value="'.$i.'"';
		if ($i == $selected)
			{
				$dd .= ' selected';
		}
		/*** get the month ***/
		$dd .= '>'.$months[$i].'</option>';
	}
$dd .= '</select>';
return $dd;
}

function check_email_address($email) {
if (!preg_match('/^\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}\b$/i', $email)) {
	return false;
}
return true;
}

function show_form() {
global $print_again, $error;
?>
<form id="feedbackform" action="" method="post">
	<fieldset class="sectionwrap">
	<legend>Gift Certificate Information</legend>
	<table width="100%" border="0" cellspacing="2" cellpadding="2">
	<tr><td colspan="2"><div align="center" style="background:#777"><strong>Gift Certificate Information</strong><br /><span style="font-style:italic;font-size:x-small">Note: All fields with an "*" must be filled out, including the recipient's shipping<br />address, so a gift card may be mailed directly to the recipient by our Front Desk Team.</span></div></div></td></tr>
	<tr><?php error_bool($error, "amount"); ?><div align="right">*Amount:</div></td><td><div align="left">$<input type="text" name="amount" size="4" value="<?php echo $_POST['amount']; ?>">(whole US Dollars, no decimals)</div></td></tr>
	<tr><?php error_bool($error, "shipTo_firstName"); ?><div align="right">*Recipient's First Name:</div></td><td><div align="left"><input type="text" name="shipTo_firstName" size="50" value="<?php echo $_POST['shipTo_firstName']; ?>"></div></td></tr>
	<tr><?php error_bool($error, "shipTo_lastName"); ?><div align="right">*Recipient's Last Name:</div></td><td><div align="left"><input type="text" name="shipTo_lastName" size="50" value="<?php echo $_POST['shipTo_lastName']; ?>"></div></td></tr>
	<tr><?php error_bool($error, "shipTo_street1"); ?><div align="right">*Recipient's Address:</div></td><td><div align="left"><input type="text" name="shipTo_street1" size="50" value="<?php echo $_POST['shipTo_street1']; ?>"></div></td></tr>
	<tr><td><div align="right">Recipient's Address 2:</div></td><td><div align="left"><input type="text" name="shipTo_street2" size="50" value="<?php echo $_POST['shipTo_street2']; ?>"></div></td></tr>
	<tr><?php error_bool($error, "shipTo_city"); ?><div align="right">*Recipient's City:</div></td><td><div align="left"><input type="text" name="shipTo_city" size="50" value="<?php echo $_POST['shipTo_city']; ?>"></div></td></tr>
	<tr><?php error_bool($error, "shipTo_state"); ?><div align="right">*Recipient's State/Province:</div></td><td><div align="left"><input type="text" name="shipTo_state" size="2" maxlength="2" value="<?php echo $_POST['shipTo_state']; ?>"> (two letters, eg, ME or NH)</div></td></tr>
	<tr><?php error_bool($error, "shipTo_postalCode"); ?><div align="right">*Recipient's Zip/Postal Code:</div></td><td><div align="left"><input type="text" name="shipTo_postalCode" size="10" value="<?php echo $_POST['shipTo_postalCode']; ?>"></div></td></tr>

	<!-- Get the country list from the countryArray function -->
	<tr><td><div align="right">*Recipient's Country:</div></td><td><div align="left"><select name="shipTo_country" >
		<?php 		$countryList1 = countryArray();
			foreach($countryList1 as $countryID1 => $countryName1) {
			if (isset($_POST['shipTo_country'])&& ($countryID1 == $_POST['shipTo_country'])) {
				echo '<option value="' . $countryID1 . '" SELECTED>' . $countryName1 . '</option>';
			} else {
				echo '<option value="' . $countryID1 .'">' . $countryName1 . '</option>';
			}
		} ?></select></div></td></tr>'

	<tr><?php error_bool($error, "shipTo_phoneNumber"); ?><div align="right">*Recipient's Phone Number:</div></td><td><div align="left"><input type="text" name="shipTo_phoneNumber" size="20" value="<?php echo $_POST['shipTo_phoneNumber']; ?>"></div></td></tr>		
	<tr valign="top"><?php error_bool($error, "shipTo_email"); ?><div align="right">*Recipient's E-Mail Address:</div></td><td><div align="left"><input type="text" name="shipTo_email" size="50" value="<?php echo $_POST['shipTo_email']; ?>"><span style="font-style:italic;font-size:x-small"><br />Note: If you enter this address, the certificate will be <br />e-mailed directly to the recipient by our system!</span></div></td></tr>
	<tr><td><div align="right">Certificate Occasion:</div></td><td><div align="left"><input type="text" name="giftOccasion" size="50" value="<?php echo $_POST['giftOccasion']; ?>"></div></td></tr>
	</table>
	</fieldset>
	<fieldset class="sectionwrap">
	<legend>Purchaser Information</legend>
	<table width="100%" border="0" cellspacing="2" cellpadding="2">
	<tr><td colspan="2"><div align="center" style="background:#777"><strong>Purchaser Information</strong><br/><span style="font-style:italic;font-size:x-small">Information entered here <strong>must match</strong><br/>billing address on file for the credit card being used.</span></div></td></tr>
	<tr><?php error_bool($error, "billTo_firstName"); ?><div align="right">*First Name (as on card):</div></td><td><div align="left"><input type="text" name="billTo_firstName" size="50" value="<?php echo $_POST['billTo_firstName']; ?>"></div></td></tr>
	<tr><?php error_bool($error, "billTo_lastName"); ?><div align="right">*Last Name (as on card):</div></td><td><div align="left"><input type="text" name="billTo_lastName" size="50" value="<?php echo $_POST['billTo_lastName']; ?>"></div></td></tr>
	<tr><?php error_bool($error, "billTo_street1"); ?><div align="right">*Billing Address:</div></td><td><div align="left"><input type="text" name="billTo_street1" size="50" value="<?php echo $_POST['billTo_street1']; ?>"></div></td></tr>
	<tr><td><div align="right">Billing Address 2:</div></td><td><div align="left"><input type="text" name="billTo_street2" size="50" value="<?php echo $_POST['billTo_street2']; ?>"></div></td></tr>
	<tr><?php error_bool($error, "billTo_city"); ?><div align="right">*City:</div></td><td><div align="left"><input type="text" name="billTo_city" size="50" value="<?php echo $_POST['billTo_city']; ?>"></div></td></tr>
	<tr><?php error_bool($error, "billTo_state"); ?><div align="right">*State/Province:</div></td><td><div align="left"><input type="text" name="billTo_state" size="2" maxlength="2" value="<?php echo $_POST['billTo_state']; ?>"> (two letters, eg, ME or NH)</div></td></tr>
	<tr><?php error_bool($error, "billTo_postalCode"); ?><div align="right">*Zip/Postal Code:</div></td><td><div align="left"><input type="text" name="billTo_postalCode" size="10" value="<?php echo $_POST['billTo_postalCode']; ?>"></div></td></tr>

	<!-- Get the country list from the countryArray function -->
	<tr><td><div align="right">*Country:</div></td><td><div align="left"><select name="billTo_country" >
		<?php $countryList = countryArray();
			foreach($countryList as $countryID => $countryName) {
			if (isset($_POST['billTo_country'])&& ($countryID == $_POST['billTo_country'])) {
				echo '<option value="' . $countryID . '" SELECTED>' . $countryName . '</option>';
			} else {
				echo '<option value="' . $countryID .'">' . $countryName . '</option>';
			}
		} ?></select></div></td></tr>

	<tr><?php error_bool($error, "billTo_email"); ?><div align="right">*E-Mail (for receipt):</div></td><td><div align="left"><input type="text" name="billTo_email" size="50" value="<?php echo $_POST['billTo_email']; ?>"></div></td></tr>
	<tr><?php error_bool($error, "billTo_phoneNumber"); ?><div align="right">*Phone Number:</div></td><td><div align="left"><input type="text" name="billTo_phoneNumber" size="20" value="<?php echo $_POST['billTo_phoneNumber']; ?>"></div></td></tr>
	</table>
	</fieldset>
	<fieldset class="sectionwrap">
	<legend>Credit Card Information</legend>
	<table width="100%" border="0" cellspacing="2" cellpadding="2">
	<tr><td colspan="2"><div align="center" style="background:#777"><strong>Credit Card Information</strong></div></td></tr>

	<!-- Get the credit card types we take from the ccTypeArray function -->
	<tr><?php error_bool($error, "ccinfo"); ?><div align="right">*Card Type:</div></td><td><div align="left"><select name="card_cardType" >
		<?php $cardname = ccTypeArray();
		foreach($cardname as $ccardID => $ccardName) {
			if (isset($_POST['card_cardType'])&& ($ccardID == $_POST['card_cardType'])) {
				echo '<option value="' . $ccardID . '" SELECTED>' . $ccardName . '</option>';
			}
			else {
				echo '<option value="' . $ccardID .'">' . $ccardName . '</option>';
			}
		} ?></select></div></td></tr>
	<tr><?php error_bool($error, "ccinfo"); ?><div align="right">*Card Number:</div></td><td><div align="left"><input type="text" name="card_accountNumber" size="20" autocomplete=off></div></td></tr>

	<!-- Get the expiration month dropdown from monthDropdown -->
	<tr><?php error_bool($error, "ccinfo"); ?><div align="right">*Expiration Month:</div></td><td><div align="left">
		<?php $name = 'card_expirationMonth';
		echo monthDropdown($name, $month);?>
		</div></td></tr>

	<!-- build the year drop down, by adding 6 to the current year -->
	<tr><?php error_bool($error, "ccinfo"); ?><div align="right">*Expiration Year:</div></td>   <td><div align="left">
		<select name="card_expirationYear" id="card_expirationYear" >
			<?PHP $year = date("Y"); for ($i = 0; $i <= 6; $i++) {echo "<option>$year</option>"; $year++;} ?></select>
		</div></td></tr>

	<tr><?php error_bool($error, "ccinfo"); ?><div align="right">*CVV (Code on back)</div></td><td><div align="left"><input type="text" name="card_cvNumber" size="4" autocomplete=off></div></td></tr>

	<tr><td colspan="2"><div align="center" style="background:#777">Additional Information</div></td></tr>
	<tr><td colspan="2"><div align="center"><textarea cols="50" rows="5" name="comment" value="<?php echo $_POST['comment']; ?>"></textarea><br />(250 characters)</div></td></tr>
	</table>
<div align="right"><input type="submit" name="submit" value="Order Now"></div>
<fieldset>
</form>
<?php
}

if(isset($_POST["submit"])) {
    check_form();
} else {
    show_form();
}

function check_form() {
global $error, $print_again;

$Accepted = array('Visa', 'MasterCard', 'American Express', 'Discover');
$CCVS = new CreditCardValidationSolution;

$error['amount'] = false;
if($_POST["amount"]=="") {
	$error['amount'] = true;
	$print_again = true;
	$message="The amount field is empty<br />";
}
if(!check_email_address($_POST['shipTo_email'])) {
	$error['shipTo_email'] = true;
	$print_again = true;
	$message.="The recipient's e-mail field is either empty or is invalid<br>";
}
$error['shipTo_firstName'] = false;
if($_POST["shipTo_firstName"]=="") {
	$error['shipTo_firstName'] = true;
	$print_again = true;
	$message="The recipient's first name field is empty<br />";
}
$error['shipTo_lastName'] = false;
if($_POST["shipTo_lastName"]=="") {
	$error['shipTo_lastName'] = true;
	$print_again = true;
	$message="The recipient's last name field is empty<br />";
}
$error['shipTo_street1'] = false;
if($_POST["shipTo_street1"]=="") {
	$error['shipTo_street1'] = true;
	$print_again = true;
	$message="The recipient's first address field is empty<br />";
}
$error['shipTo_city'] = false;
if($_POST["shipTo_city"]=="") {
	$error['shipTo_city'] = true;
	$print_again = true;
	$message="The recipient's city field is empty<br />";
}
$error['shipTo_state'] = false;
if($_POST["shipTo_state"]=="") {
	$error['shipTo_state'] = true;
	$print_again = true;
	$message="The recipient's state field is empty<br />";
}
$error['shipTo_postalCode'] = false;
if($_POST["shipTo_postalCode"]=="") {
	$error['shipTo_postalCode'] = true;
	$print_again = true;
	$message="The recipient's postal/zip code field is empty<br />";
}
$error['shipTo_phoneNumber'] = false;
if($_POST["shipTo_phoneNumber"]=="") {
	$error['shipTo_phoneNumber'] = true;
	$print_again = true;
	$message="The recipient's phone number field is empty<br />";
}
$error['billTo_firstName'] = false;
if($_POST["billTo_firstName"]=="") {
	$error['billTo_firstName'] = true;
	$print_again = true;
	$message="The purchaser's first name field is empty<br />";
}
$error['billTo_lastName'] = false;
if($_POST["billTo_lastName"]=="") {
	$error['billTo_lastName'] = true;
	$print_again = true;
	$message="The purchaser's last name field is empty<br />";
}
$error['billTo_street1'] = false;
if($_POST["billTo_street1"]=="") {
	$error['billTo_street1'] = true;
	$print_again = true;
	$message="The purchaser's first address field is empty<br />";
}
$error['billTo_city'] = false;
if($_POST["billTo_city"]=="") {
	$error['billTo_city'] = true;
	$print_again = true;
	$message="The purchaser's city field is empty<br />";
}
$error['billTo_state'] = false;
if($_POST["billTo_state"]=="") {
	$error['billTo_state'] = true;
	$print_again = true;
	$message="The purchaser's state field is empty<br />";
}
$error['billTo_postalCode'] = false;
if($_POST["billTo_postalCode"]=="") {
	$error['billTo_postalCode'] = true;
	$print_again = true;
	$message="The purchaser's Postal/ZIP code field is empty<br />";
}
if(!check_email_address($_POST['billTo_email'])) {
	$error['billTo_email'] = true;
	$print_again = true;
	$message.="The purchaser's e-mail field is either empty or is invalid<br>";
}
$error['billTo_phoneNumber'] = false;
if($_POST["billTo_phoneNumber"]=="") {
	$error['billTo_phoneNumber'] = true;
	$print_again = true;
	$message="The purchaser's phone number field is empty<br />";
}
/*	$error['ccinfo'] = false;
	if (!$CCVS->validateCreditCard($card_accountNumber,'en',$Accepted,'Y',$card_expirationMonth,$card_expirationYear)){
		error_log("$card_accountNumber,'en',$Accepted,'Y',$card_expirationMonth,$card_expirationYear",0);
	$error['ccinfo'] = true;
	$print_again = true;
	$message="The credit card data entered is incorrect<br />";
}*/
if($print_again) {
	show_form();
} else {
	// Show field confirmation table
	?>

	<p><div align="center" style="font-size:larger;"><strong>If everything below looks right, then click the "<u>Buy Now</u>"<br />button at the bottom of the page!</strong></div></p>
	<table width="100%" border="0" cellspacing="2" cellpadding="2">
		<tr>
			<td colspan="2"><div align="center" style="background:#222"><strong>Gift Certificate Information</strong></div></td>
		</tr>
		<tr>
			<td><div align="right">*Amount:</div></td>
			<td><div align="left">$<?php echo $_POST['amount']; ?>(US Dollars)</div></td>
		</tr>
		<tr>
			<td><div align="right">Recipient's First Name:</div></td>
			<td><div align="left"><?php echo $_POST['shipTo_firstName']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Recipient's Last Name:</div></td>
			<td><div align="left"><?php echo $_POST['shipTo_lastName']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Recipient's Address:</div></td>
			<td><div align="left"><?php echo $_POST['shipTo_street1']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Recipient's Address 2:</div></td>
			<td><div align="left"><?php echo $_POST['shipTo_street2']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Recipient's City:</div></td>
			<td><div align="left"><?php echo $_POST['shipTo_city']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Recipient's State/Province:</div></td>
			<td><div align="left"><?php echo $_POST['shipTo_state']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Recipient's Zip/Postal Code:</div></td>
			<td><div align="left"><?php echo $_POST['shipTo_postalCode']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Recipient's Country:</div></td>
			<td><div align="left"><?php echo $_POST['shipTo_country']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Recipient's Phone Number:</div></td>
			<td><div align="left"><?php echo $_POST['shipTo_phoneNumber']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Recipient's E-Mail Address:</div></td>
			<td><div align="left"><?php echo $_POST['shipTo_email']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Certificate Occasion:</div></td>
			<td><div align="left"><?php echo $_POST['giftOccasion']; ?></div></td>
		</tr>
		<tr>
			<td colspan="2"><div align="center" style="background:#222"><strong>Customer Information</strong></div></td>
		</tr>
		<tr>
			<td><div align="right">*First Name:</div></td>
			<td><div align="left"><?php echo $_POST['billTo_firstName']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">*Last Name:</div></td>
			<td><div align="left"><?php echo $_POST['billTo_lastName']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Address:</div></td>
			<td><div align="left"><?php echo $_POST['billTo_street1']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Address 2:</div></td>
			<td><div align="left"><?php echo $_POST['billTo_street2']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">City:</div></td>
			<td><div align="left"><?php echo $_POST['billTo_city']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">State/Province:</div></td>
			<td><div align="left"><?php echo $_POST['billTo_state']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Zip/Postal Code:</div></td>
			<td><div align="left"><?php echo $_POST['billTo_postalCode']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Country:</div></td>
			<td><div align="left"><?php echo $_POST['billTo_country']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">E-Mail (for receipt):</div></td>
			<td><div align="left"><?php echo $_POST['billTo_email']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Phone Number:</div></td>
			<td><div align="left"><?php echo $_POST['billTo_phoneNumber']; ?></div></td>
		</tr>
		<tr>
			<td colspan="2"><div align="center" style="background:#222"><strong>Credit Card Information</strong></div></td>
		</tr>
		<tr>
			<td><div align="right">Card Type:</div></td>
			<td><div align="left"><?php echo $_POST['card_cardType']; ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Card Number:</div></td>
			<td><div align="left"><?php echo preg_replace("/[^- ]/", "X", substr($_POST['card_accountNumber'],0,-4)) . substr($_POST['card_accountNumber'],-4); ?></div></td>
		</tr>
		<tr>
			<td><div align="right">Expiration Month:</div></td>
			<td><div align="left"><?php echo $_POST['card_expirationMonth']; ?>(mm)</div></td>
		</tr>
		<tr>
			<td><div align="right">Expiration Year:</div></td>
			<td><div align="left"><?php echo $_POST['card_expirationYear']; ?>(yyyy)</div></td>
		</tr>
		<?php if (isset($_POST['comment']) && $_POST['comment']!=""){
			echo "<tr><td colspan=\"2\"><div align=\"center\" style=\"background:#222\">Additional Information</div></td></tr>";
			echo "<tr><td colspan=\"2\"><div align=\"center\"><textarea cols=\"50\" rows=\"5\" readonly>" . stripslashes($_POST['comment']) . "</textarea></div></td></tr>";
		}?>
	</table>

	<!-- ProcessOrder.do or CheckOrderData.do based on process or check data sent -->
	<!-- Testing Process -->
<!--		<form action="https://orderpagetest.ic3.com/hop/ProcessOrder.do" method="post" onsubmit="document.getElementById('submit_button').disabled = 1;document.getElementById('submit_button').value='Submitting';">
-->
	<!-- Live Process -->
		<form action="https://orderpage.ic3.com/hop/ProcessOrder.do" method="post" onsubmit="document.getElementById('submit_button').disabled = 1;document.getElementById('submit_button').value='Submitting';">
	<?php $amount=$_POST['amount']; ?>
	<?php InsertSignature3("$amount", "usd", "sale"); ?>
	<input type="hidden" name="amount" value="<?php echo $_POST['amount']; ?>">
	<input type="hidden" name="shipTo_firstName" value="<?php echo $_POST['shipTo_firstName']; ?>">
	<input type="hidden" name="shipTo_lastName" value="<?php echo $_POST['shipTo_lastName']; ?>">
	<input type="hidden" name="shipTo_street1" value="<?php echo $_POST['shipTo_street1']; ?>">
	<input type="hidden" name="shipTo_street2" value="<?php echo $_POST['shipTo_street2']; ?>">
	<input type="hidden" name="shipTo_city" value="<?php echo $_POST['shipTo_city']; ?>">
	<input type="hidden" name="shipTo_state" value="<?php echo $_POST['shipTo_state']; ?>">
	<input type="hidden" name="shipTo_postalCode" value="<?php echo $_POST['shipTo_postalCode']; ?>">
	<input type="hidden" name="shipTo_country" value="<?php echo $_POST['shipTo_country']; ?>">
	<input type="hidden" name="shipTo_email" value="<?php echo $_POST['shipTo_email']; ?>">
	<input type="hidden" name="shipTo_phoneNumber" value="<?php echo $_POST['shipTo_phoneNumber']; ?>">
	<input type="hidden" name="giftOccasion" value="<?php echo $_POST['giftOccasion']; ?>">
	<input type="hidden" name="billTo_firstName" value="<?php echo $_POST['billTo_firstName']; ?>">
	<input type="hidden" name="billTo_lastName" value="<?php echo $_POST['billTo_lastName']; ?>">
	<input type="hidden" name="billTo_street1" value="<?php echo $_POST['billTo_street1']; ?>">
	<input type="hidden" name="billTo_street2" value="<?php echo $_POST['billTo_street2']; ?>">
	<input type="hidden" name="billTo_city" value="<?php echo $_POST['billTo_city']; ?>">
	<input type="hidden" name="billTo_state" value="<?php echo $_POST['billTo_state']; ?>">
	<input type="hidden" name="billTo_postalCode" value="<?php echo $_POST['billTo_postalCode']; ?>">
	<input type="hidden" name="billTo_country" value="<?php echo $_POST['billTo_country']; ?>">
	<input type="hidden" name="billTo_email" value="<?php echo $_POST['billTo_email']; ?>">
	<input type="hidden" name="billTo_phoneNumber" value="<?php echo $_POST['billTo_phoneNumber']; ?>">
	<input type="hidden" name="card_cardType" value="<?php echo $_POST['card_cardType']; ?>">
	<input type="hidden" name="card_accountNumber" value="<?php echo $_POST['card_accountNumber']; ?>">
	<input type="hidden" name="card_expirationMonth" value="<?php echo $_POST['card_expirationMonth']; ?>">
	<input type="hidden" name="card_expirationYear" value="<?php echo $_POST['card_expirationYear']; ?>">
	<input type="hidden" name="card_cvNumber" value="<?php echo $_POST['card_cvNumber']; ?>">
	<input type="hidden" name="comment" value="<?php echo $_POST['comment']; ?>">
	<div  align="right"><input id="submit_button" type="submit" name="submit" value="Buy Now"></div>
</form>
<?php
}}
?>
</div>
</div>
<br class="clearfloat" />
<div id="footer">
<!--#include virtual="includes/footer.php" -->
<?php include("includes/footer.php"); ?>
<script type="text/javascript">
<!--
swfobject.registerObject("menu");
//-->
</script>
</body>
</html>

 

It looks like you will need to adjust the layout to get it to look the way you want.

Link to comment
Share on other sites

It looks Great but I'm trying to get them on 3 seperate pages, It's seperated by boxes right now with the above suggested code but they are all on the same page still? Is there a way to make a "Next Page" button and hide all of the data from the previous page until the individual clicks submit?

 

Here is the Beta i'm uploading to so I can test it before it goes to production. https://akaribeauty.com/beta/secure/order.php

 

Cheers and Beers!

 

 

 

 

Link to comment
Share on other sites

Sledge hammer approach (obvioulsy this is just an idea as to how you might approach the problem - I have not added in error handing or security issues)

...

 

4 pages

 

page 1: first form (use php extension)

A. start sessions

B. Display the first form

C. submit to page 2

 

page 2: Second form (php extension)

A: Start sessions

B. grab data from form 1 using $_POST

C. Store form 1 data in session variables

D. display form 2

E. submit to page 3

 

page 3: Third form (php extension)

A. Start sessions

B. grab data from form 2 using $_POST

C. store form 2 data in session variables

D. display form 3

E. submit to page 4

 

page 4: Process all data (php extension)

A. Start sessions

B grab data from form 3 using $_POST

C. grab data from session variables

D. process the data

 

 

Link to comment
Share on other sites

Ok.. Some VERY rough, crude examples.  The key to learning is start small, learn the basics, EXPERIMENT! That said...

 

form 1

<?PHP
session_start();
?>
<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<title>form 1</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#000000" vlink="#000000" alink="#000000">
This is Form 1<br>
<form action="form2.php" method="post">
First name: <input type="text" name="firstname" size="40" maxlength="80" value=""><br>
Last name: <input type="text" name="lastname" size="40" maxlength="80" value=""><p>
<input type="submit" value="Continue to page 2">
</form>
</body>
</html>

 

form 2

 

<?PHP
session_start();
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname];
$_SESSION['firstname'] = $firstname;
$_SESSION['lastname'] = $lastname;
?>
<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<title>form 2</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#000000" vlink="#000000" alink="#000000">
This is Form 2<br>
<form action="form3.php" method="post">
Type of credit card: <input type="text" name="typecard" size="40" maxlength="80" value=""><br>
Card Number: <input type="text" name="cardnumber" size="40" maxlength="80" value=""><br>
Sec Code: <input type="text" name="seccode" size="3" maxlength="4" value=""><p>
<input type="submit" value="Continue to page 3">
</form>
</body>
</html>

 

form 3

<?PHP
session_start();
$typecard = $_POST['typecard'];
$cardnumber = $_POST['cardnumber'];
$seccode = $_POST['seccode'];
$_SESSION['typecard'] = $typecard;
$_SESSION['cardnumber'] = $cardnumber;
$_SESSION['seccode'] = $seccode;
?>
<!doctype html public "-//w3c//dtd html 3.2//en">
<html>
<head>
<title>form 3</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#000000" vlink="#000000" alink="#000000">
This is Form 3<br>
<form action="page4.php" method="post">
Your dog's name: <input type="text" name="dogsname" size="40" maxlength="80" value=""><br>
<input type="submit" value="Finish">
</form>
</body>
</html>

page4

 

<?PHP
session_start();
$dogsname = $_POST['dogsname];
$firstname = $_SESSION['firstname'];
$lastname = $_SESSION['lastname'];
$typecard = $SESSION['typecard'];
$cardnumber = $SESSION['cardnumber'];
$seccode = $_SESSION['seccode'];
/*
do whatever you want with the data
*/

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.