-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
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 — Wellness ♦ Beauty ♦ Style ♦ 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.
-
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.
-
You could use a pre-existing script - http://www.dynamicdrive.com/dynamicindex16/formwizard.htm
-
The "query was empty error" is because the string you put into the mysql_query() statement was empty or the wrong variable name. You would need to post your code if you want help with the error. If you have pre 1901 dates stored as DATE or DATETIME data types, using DATE_FORMAT() should work.
-
Win 7 Installation Can't Find php.ini file
PFMaBiSmAd replied to lehket's topic in PHP Installation and Configuration
Any chance you edited the php.ini using a Windows application and it ended up saved as php.ini.txt but you cannot see the actual .txt extension because it is hidden by default? -
You would need to test $_POST['submit_x'] to detect if the form was submitted (or you would need to use a hidden field with name='submit'). The browsers that are following the w3.org HTML specification don't set $_POST['submit']
-
See this post/thread - http://www.phpfreaks.com/forums/php-coding-help/ie-doesn%27t-submit-form-but-firefox-does/msg1496053/#msg1496053
-
Php created .png shown using string not using temp file
PFMaBiSmAd replied to johnmunro's topic in PHP Coding Help
And just which part of that code would be the part that is relevant to your question? -
Functions have their own private variable scope so that they don't have any unintended interaction with the program where you use the function. Writing larger programs would become impossible if you needed to keep track of all the variables you used in and out of functions.
-
You need to pass $conn into the function when you call it - CreateSchoolCheckboxes($conn);
-
The only thing a header() statement does is send a HTTP header to the browser - http://us3.php.net/manual/en/function.header.php
-
The posted code is not secure at all. You need an exit; statement after your header() redirect to prevent the remainder of the code on the 'protected' page from being executed.
-
If your eventdate column was a mysql DATE data type (YYYY-MM-DD), you could do this directly in the query, because dates in that format can be directly compared and you can use the numerous mysql date/time functions on it to form a date x days in the future to compare with.
-
You are not even trying the same queries at the mysql prompt that you are running in your php code. At least your first query is failing with an sql error because the number of fields and the number of data values don't match. Your php code should have error checking logic (check if a query worked or failed), error reporting/logging logic (output a user error message and log system level information about the error), and error recovery logic (what execution path do you take when there is an error, attempt to use missing data and generate more errors or skip over dependent code?)
-
Sorry to be blunt, but the problem is inconstant and minimal coding. The undefined index errors are due to mistyped and nonexistent names. The 'Use of undefined constant' errors are because of missing quotes around the array index associative names. Did anyone (the OP and his buddy that gave him this code) look at each line of code an TRY to determine why it is producing an error? Is usrename spelled correctly? Is there a form field named pass? For all the lines with undefined constant errors ($birth[d]) the error messages assumed 'd' told you what the php language assumed they should be.
-
^^^ Yes, simply read the error messages, they tell you where the output is occurring at that is preventing the header from working. Something at or up to line 8 in index.php is sending output to the browser - You would need to find what is causing that output to be sent before a header statement and eliminate it, assuming it was unintended output or correct the code so that any logic that sends a header is located before you produce and send any output to the browser.
-
imagecreate, imagettftext and font path error
PFMaBiSmAd replied to icekat83's topic in PHP Coding Help
To output an image on a web page you must use an <img src="URL that results in the image being output to the browser" alt=""> HTML tag. See this link for the definition of an <img ...> tag - http://w3schools.com/html/html_images.asp The "URL that results in the image being output to the browser" would be where your function you have posted would be at and where you would call it. You cannot use that function on the HTML page where you want the image to be displayed. That's not how web pages work. -
The following link is a basic php/mysql tutorial that shows how to execute a select query and fetch the results from the query - http://w3schools.com/php/php_mysql_select.asp
-
Help with slashes appearing before quote marks
PFMaBiSmAd replied to damion's topic in PHP Coding Help
See this information - http://us3.php.net/magic_quotes Php.net thought it was better to automatically escape all external data, even if you weren't going to use the data in a query, rather than have someone spend a minute to learn a how to correctly escape data being put into a query. If magic_quotes_gpc is on, you need to use stripslashes on your data to remove the escape characters or if the option is available to you, turn off the magic_quotes_gpc setting. You cannot unconditionally use stripslashes on your data as that would eliminate intentional \ characters in it when magic_quotes_gpc is not on. -
'AS' is optional. Did you even try the query that was posted?
-
Or you could have just used a different name for each type='image' field using one form and had a lot less HTML.
-
Why are you trying to include using a URL? That takes a minimum of 10 times longer than including a file through the file system.
-
Your while loop is fetching each row from the result set into $category as an array. So, since you are SELECTing id and cateName in your query statement, you are getting $category['id'] and $category['cateName''] from each row. When you use a foeach() loop on $category, it loops twice, first for the $category['id'] element of $category and second with the $category['cateName''] element of $category from the current row. What are you trying to accomplish?
-
IE submits your form just fine. It's your form processing code that is not reading the data correctly. Check out this link - http://us2.php.net/manual/en/faq.html.php#faq.html.form-image The HTML specification requires that browsers send the x and y coordinates where the image was clicked. It is not even part of the HTML specification that browsers send the name/value of a type='image' field and you will find that IE and I believe Opera don't send the name/value, while the other browsers do their own thing and do send it. Once you change your form processing code so that it checks either the _x or _y variation of the name="" attribute (you will need to give each of your images a different name="" in order to be able to detect which one was clicked), your code will work in all the browsers.