Jump to content

check


JimKI

Recommended Posts

A form that calculates the total of checks of the the states then multiplies it by an original amount and then two other price points then gives a total with the list of the states selected and the total. also a check box for logo that if checked adds to the total and then the total goes to pay pal. can this be done. here is what i have so far but then got lost. I also need to know if I have gone in the wrong direction. ideas how to proceed thanks. Jim<?php print "\n<!-- begin " . __FILE__ . " -->\n" ; global $lowerStateCode; // Pick list of B2B categories require_once($_SERVER['DOCUMENT_ROOT'] . '/8.0/lib/_b2b_svc_types_array.php')?> <div id="netFormTitle">Biz Partners Referral Registration</div> <div class="blockSubtitle netTextColor">Business-to-Business Product and Service Providers</div> <div>Network in buzgate.org to drive leads.</div> <div>Sponsor an interactive listing of your offerings in buzgate.org to build brand awareness, generate sales leads and improve SEO positioning. A representative will contact you to process payment and confirm the accuracy of your listing.</div> <div><strong>Pricing:</strong> $89.95 per state per year, plus $59.95 w/logo. Multiple state discounts available.</div> <div><span class="bold">*</span>Required Fields are marked with an asterisk and highlighted</div> <div id="registerFH"> <form action="<?php ($_SERVER['QUERY_STRING'])? print $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'] : print $_SERVER['PHP_SELF'] ; ?>" method="POST" name="dgf" onsubmit="return validateForm(this,requiredTextFields,requiredSelectFields,requiredCheckboxFields);"> <fieldset><legend>Contact and Listing Information</legend> <div class="fhFormLeft2"> <!-- HACK: HAD TO USE MARGIN TOP, VERTICAL-ALIGN:MIDDLE; DOESN'T WORK --> <label for="dgfCategory" class="dgfLabel">*Industry Category</label> </div> <div class="fhFormRight2"> <select name="dgfCategory" id="dgfCategory" value="<?php print $dgfCategory; ?>" class="required"> <?php $b2bCategories = $b2b_types_short; asort($b2bCategories); // use custom sort algorithm from lib main #$sortedList = array_sort($b2bCategories,1); //if ($sortedList) print 'true'; $optionList = ''; foreach ($b2bCategories as $k => $v) { $optionList .= '<option value="' . $k . '"'; $optionList .= (strtolower($k)==strtolower($_POST['dgfCategory']))? ' selected="selected" ':''; $optionList .= '>' . $v . '</option>'. "\n"; } #$optionList = makeOptionsListFromArray($b2bCategories, $_POST['dgfCategory'] ); print ($optionList); ?> </select> <?php #print_r($b2bCategories); ?> <!-- reuse this for 'other' <input type="text" name="dgfCategory" id="dgfCategory" value="<?php print $dgfCategory; ?>" size="40" maxlength="100" class="required" /> --> </div> <br clear="all" /> <div class="fhFormLeft2"> <label for="dgfCompanyName" class="dgfLabel">*Company Name</label> <?php print $dgfError['dgfCompanyName'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfCompanyName" id="dgfCompanyName" value="<?php print $dgfCompanyName; ?>" size="40" maxlength="100" onfocus="statusBarMsg('What is your Company?');" onblur="window.status='';" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfAddress1" class="dgfLabel">*Address 1</label> <?php print $dgfError['dgfAddress1'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfAddress1" id="dgfAddress1" value="<?php print $dgfAddress1; ?>" size="40" maxlength="50" onfocus="statusBarMsg('What is your Address?');" onblur="window.status='';" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfAddress2" class="dgfLabel">Address 2</label> <?php print $dgfError['dgfAddress2'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfAddress2" id="dgfAddress2" value="<?php print $dgfAddress2; ?>" size="40" maxlength="50" onfocus="statusBarMsg('Enter additional address information if needed.');" onblur="window.status='';" /> </div> <div class="fhFormLeft2"> <label for="dgfCity" class="dgfLabel">*City</label> <?php print $dgfError['dgfCity'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfCity" id="dgfCity" value="<?php print $dgfCity; ?>" size="40" maxlength="50" onfocus="statusBarMsg('What is your city?');" onblur="window.status='';" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfState" class="dgfLabel">*State</label> <?php print $dgfError['dgfState'] ; ?> </div> <div class="fhFormRight2"> <select name="dgfState" id="dgfState" size="1" onfocus="statusBarMsg('Choose \'other\' if not applicable.')" onblur="window.status='';" class="required"> <?php $stateList = file2Array($_SERVER['DOCUMENT_ROOT'] . '/8.0/lib/forms/_codes_50states.txt',':::'); asort($stateList); $stateOptions = makeOptionsListFromArray($stateList, $GLOBALS['stateCode']); print $stateOptions; ?> </select> </div> <div class="fhFormLeft2"> <label for="dgfZip" class="dgfLabel">*Zip/Postal Code</label> <?php print $dgfError['dgfZip'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfZip" id="dgfZip" value="<?php print $dgfZip; ?>" size="10" maxlength="15" onfocus="statusBarMsg(sWorldPostalCode)" onblur="window.status='';" onchange="if(!isZIPCode(stripCharsInBag(this.value, ZIPCodeDelimiters))){checkPostalCode(this, false)};" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfWebAddress" class="dgfLabel">Web Address:</label> <?php print $dgfError['dgfWebAddress'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfWebAddress" id="dgfWebAddress" value="<?php if (empty($dgfWebAddress)) {print 'http://';} else {print $dgfWebAddress;} ?>" size="40" onfocus="statusBarMsg('If more than one, you can enter multiple addresses separated by commas.')" onblur="window.status='';" > </div> <div class="fhFormLeft2"> <label for="dgfFirstName" class="dgfLabel">*First Name</label> <?php print $dgfError['dgfFirstName'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfFirstName" id="dgfFirstName" value="<?php print $dgfFirstName; ?>" size="40" maxlength="50" onchange="if(isItEmpty(this.value)) { alertMsg(this.form.name,this.name,'Please tell us your first name (given name).');}" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfLastName" class="dgfLabel">*Last Name</label> <?php print $dgfError['dgfLastName'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfLastName" id="dgfLastName" value="<?php print $dgfLastName; ?>" size="40" maxlength="50" onchange="if(isItEmpty(this.value)) { alertMsg(this.form.name, this.name, 'Please tell us your last name (family name).');}" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfTitle" class="dgfLabel">Title</label> <?php print $dgfError['dgfTitle'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfTitle" id="dgfTitle" value="<?php print $dgfTitle; ?>" size="40" maxlength="50" /> </div> <div class="fhFormLeft2"> <label for="dgfEmail" class="dgfLabel">*Email</label> <?php print $dgfError['dgfEmail'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfEmail" id="dgfEmail" value="<?php print $dgfEmail; ?>" size="40" maxlength="50" onfocus="statusBarMsg('Please enter your work email address.')" onblur="window.status='';" onchange="checkEmail(this,false);" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfPhoneBiz" class="dgfLabel">*Business Phone</label> <?php print $dgfError['dgfPhoneBiz'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfPhoneBiz" id="dgfPhoneBiz" value="<?php print $dgfPhoneBiz; ?>" size="15" maxlength="30" onfocus="statusBarMsg('Enter a 10-digit US phone, or an International phone number starting with +.')" onblur="window.status='';" onchange="normalizedPhone = stripCharsInBag (this.value, phoneNumberDelimiters); if (isUSPhoneNumber (normalizedPhone, false)) { this.value = reformatUSPhone (normalizedPhone); }" class="required" /> </div> <div class="fhFormLeft2"> <label for="dgfPhoneFax" class="dgfLabel">Fax</label> <?php print $dgfError['dgfPhoneFax'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfPhoneFax" id="dgfPhoneFax" value="<?php print $dgfPhoneFax; ?>" size="15" onfocus="statusBarMsg('Enter a 10-digit US phone, or an International phone number starting with +.')" onblur="window.status='';" onchange="normalizedPhone = stripCharsInBag (this.value, phoneNumberDelimiters); if (isUSPhoneNumber (normalizedPhone, false)) { this.value = reformatUSPhone (normalizedPhone); }" maxlength="30" /> </div> </fieldset> <div>Briefly describe your business offerings.</div> <div> <label for="dgfComments" class="dgfLabel"> *Description<br />(limit 1,000 words)<br /> <textarea name="dgfComments" id="dgfComments" onfocus="statusBarMsg('Additional Comments')" onblur="window.status='';" rows="3" cols="60" onchange="limitWords(this.form.dgfComments, 1000);" class="required"><?php print $dgfComments ; ?> </textarea> </label> </div> <div> <fieldset class="required"> <legend>*Check State(s) Served</legend> <?php print makeCheckboxesFromArray(file2Array($_SERVER['DOCUMENT_ROOT'] . '/8.0/lib/forms/_codes_50states.txt',':::'),'dgfRegion', $stateCode, '|n/a|i', 10, 'Nationwide'); ?> </fieldset> </div> <form id="form1" name="form1" method="post" action=""> <input type="checkbox" name="logo" id="logo" /> Check box if to include optional logo placement $24.95 per year.<br /> </form> <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="UBU4VYXT3ERH4"><input type="image" src="https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"></form><p> <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="RLJU2T8QX9FYN"><table><tr><td><input type="hidden" name="on0" value="States Pricing">States Pricing</td></tr><tr><td><select name="os0"> <option value="1-9 States">1-9 States $89.95</option> <option value="10-24 States">10-24 States $59.95</option> <option value="25 -50 States (plus PR and HI) and Nationwide">25 -50 States (plus PR and HI) and Nationwide $39.95</option></select> </td></tr></table><input type="hidden" name="currency_code" value="USD"><input type="image" src="https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"></form> <br/><br/> <div class="fhFormLeft2"><label for="dgfSecureCode" class="dgfLabel">*Anti-Spam code</label> <?php print $dgfError['dgfSecureCode'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="dgfSecureCode" id="dgfSecureCode" value="" size="6" maxlength="6" class="required" onChange="if(isItEmpty(this.value)) {alertMsg(this.form.name,this.name,'Please enter the anti-spam code to submit this form.');}"> <?php if ($_SESSION['secureImages'] > '') { print '  ' . $_SESSION['secureImages']; } ?> <br /> </div> <div> <br /><br /> <label for="dgfNote" class="dgfLabel">When is a <b>convenient time</b> to contact you?</label> <?php print $dgfError['dgfNote'] ; ?> <input type="text" name="dgfNote" id="dgfNote" value="<?php print $dgfNote; ?>" size="40" maxlength="50" /> </div> <div> <label for="dgfCC" class="dgfLabel"> <input type="checkbox" name="dgfCC" id="dgfCC" value="sentCarbonCopy" checked> Check here to receive a copy of this form (at the above email address). </label> </div> <div> <label for="dgfReset" class="dgfLabel"> <input type="reset" name="dgfReset" id="dgfReset" value="Clear" /> </label> <input name="dgfAction" type="hidden" value="processForm" /> <label for="dgfSubmit" class="dgfLabel"> <input type="submit" name="dgfSubmit" id="dgfSubmit" value="Submit Form" /> </label> </div></form></div>

Link to comment
Share on other sites

I know have this form but it doesn't calculate right it only puts 1 in the totall states box and it put the amount of one in the total price box. <!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" /><title>Untitled Document</title><script type="text/javascript">function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0;}</script><style type="text/css">div { text-align: left;}</style></head><body><a name="result"></a><form action="orderprocess.php" method="post"><div id="netFormTitle">Biz Partners Referral Registration</div> <div class="blockSubtitle netTextColor">Promote Your Business-to-Business Product and Services</div> <div>Leverage the BUZGate business-to-business referral network to generate leads and increase sales among small and medium-sized business. An interactive listing is less than $8.00 per month, per state.</div> <div>Use the form below to choose what state(s) you want your listing to appear in and our marketing team will publish your business information and email you for content/link confirmation. </div> <div><strong> Pricing:</strong> $89.95 per state per year, plus $29.95 w/logo. Multiple state discounts available.</div> <div> <p><span class="bold">*</span>Required Fields are marked with an asterisk and highlighted</p> <p> <legend>Contact and Listing Information</legend></p> <div class="fhFormLeft2"> <!-- HACK: HAD TO USE MARGIN TOP, VERTICAL-ALIGN:MIDDLE; DOESN'T WORK --></div> </div> <p>*Industry Category <br/> <select name="Industry Category" id="Industry Category"> <option>Accounting</option> <option>Angel Funding</option> <option>Business Coaching</option> <option> Computer HardwareCredit Programs</option> <option>Credit Reporting</option> <option>CRM</option> <option>Data Backup and Recovery</option> <option>Distance Learning</option> <option>E-commerce</option> <option>Employment / HR</option> <option>Factoring</option> <option>Financial Consultants</option> <option>Financial Institutions</option> <option>Franchise Opportunites</option> <option>Funding Sources</option> <option>Graphic Design</option> <option>eMail Marketing</option> <option>Information Technology</option> <option>Insurance</option> <option>Leasing</option> <option>Legal Services</option> <option>Mailing Solutions</option> <option>Management Consulting</option> <option>Marketing & P.R.</option> <option>Mediation & Dispute Resolution</option> <option>Merchant Services</option> <option>Newspapers / Publications</option> <option>Office & Conference</option> <option>Printing / Copying</option> <option>Real Estate</option> <option>Retirement Planning</option> <option>Sales Consulting/Svc</option> <option>Search Engine Optimization (SEO)</option> <option>Shipping / Courier</option> <option>Software</option> <option>Telecom / ISP</option> <option>Transportation</option> <option>Travel</option> <option>Utilities</option> <option>Venture Capital</option> <option>Web Conferencing</option> <option>Websites & Hosting</option> </select> <div class="fhFormLeft2"> <label for="CompanyName" class="Label">*Company Name</label> </div> <div class="fhFormRight2"> <input type="text" name="CompanyName" id="CompanyName" value="" size="40" maxlength="100" /> </div> <div class="fhFormLeft2"> <label for="Address1" class="Label">*Address 1</label></div> <div class="fhFormRight2"> <input type="text" name="Address1" id="Address1" value="" size="40" maxlength="50" /> </div> <div class="fhFormLeft2"> <label for="Address2" class="Label">Address 2</label> </div> <div class="fhFormRight2"> <input type="text" name="Address2" id="Address2" value="" size="40" maxlength="50" onfocus="statusBarMsg('Enter additional address information if needed.');" onblur="window.status='';" /> </div> <div class="fhFormLeft2"> <label for="City" class="Label">*City</label> </div> <div class="fhFormRight2"> <input type="text" name="City" id="City" value="" size="40" maxlength="50" onfocus="statusBarMsg('What is your city?');" onblur="window.status='';" class="required" /> </div> <div class="fhFormLeft2"> </div> <p>*State <select name="State" id="State"> <option selected="selected">AK</option> <option>AL</option> <option>AR</option> <option>AZ</option> <option>CA</option><option>CO</option><option>CT</option><option>DC</option><option>DE</option><option>FL</option><option>GA</option><option>HI</option><option>IA</option><option>ID</option><option>IL</option><option>IN</option><option>KS</option><option>KY</option><option>LA</option><option>MA</option><option>MD</option><option>ME</option><option>MI</option><option>MN</option><option>MO</option><option>MS</option><option>MT</option><option>NC</option><option>ND</option><option>NE</option><option>NH</option><option>NJ</option><option>NM</option><option>NV</option><option>NY</option><option>OH</option><option>OK</option><option>OR</option><option>PA</option><option>PR</option><option>RI</option><option>SC</option> <option>SD</option> <option>TN</option><option>TX</option> <option>UT</option> <option>VA</option> <option>VT</option> <option>WA</option> <option>WI</option> <option>WV</option> <option>WY</option> <option>Other</option> </select> <div class="fhFormLeft2"> <label for="Zip" class="Label">*Zip/Postal Code</label> </div> <div class="fhFormRight2"> <input type="text" name="Zip" id="Zip" value="" size="10" maxlength="15" onfocus="statusBarMsg(sWorldPostalCode)" onblur="window.status='';" onchange="if(!isZIPCode(stripCharsInBag(this.value, ZIPCodeDelimiters))){checkPostalCode(this, false)};" class="required" /> </div> <div class="fhFormLeft2"> <label for="WebAddress" class="Label">Web Address:</label> </div> <div class="fhFormRight2"> <input type="text" name="WebAddress" id="WebAddress" value="" size="40" onfocus="statusBarMsg('If more than one, you can enter multiple addresses separated by commas.')" onblur="window.status='';" > </div> <div class="fhFormLeft2"> <label for="FirstName" class="Label">*First Name</label> </div> <div class="fhFormRight2"> <input type="text" name="FirstName" id="FirstName" value="" size="40" maxlength="50" onchange="if(isItEmpty(this.value)) { alertMsg(this.form.name,this.name,'Please tell us your first name (given name).');}" class="required" /> </div> <div class="fhFormLeft2"> <label for="LastName" class="Label">*Last Name</label> </div> <div class="fhFormRight2"> <input type="text" name="LastName" id="LastName" value="" size="40" maxlength="50" onchange="if(isItEmpty(this.value)) { alertMsg(this.form.name, this.name, 'Please tell us your last name (family name).');}" class="required" /> </div> <div class="fhFormLeft2"> <label for="Title" class="Label">Title</label> </div> <div class="fhFormRight2"> <input type="text" name="Title" id="Title" value="" size="40" maxlength="50" /> </div> <div class="fhFormLeft2"> <label for="Email" class="Label">*Email</label> </div> <div class="fhFormRight2"> <input type="text" name="Email" id="Email" value="" size="40" maxlength="50" onfocus="statusBarMsg('Please enter your work email address.')" onblur="window.status='';" onchange="checkEmail(this,false);" class="required" /> </div> <div class="fhFormLeft2"> <label for="PhoneBiz" class="Label">*Business Phone</label> </div> <div class="fhFormRight2"> <input type="text" name="PhoneBiz" id="PhoneBiz" value="" size="15" maxlength="30" onfocus="statusBarMsg('Enter a 10-digit US phone, or an International phone number starting with +.')" onblur="window.status='';" onchange="normalizedPhone = stripCharsInBag (this.value, phoneNumberDelimiters); if (isUSPhoneNumber (normalizedPhone, false)) { this.value = reformatUSPhone (normalizedPhone); }" class="required" /> </div> <div class="fhFormLeft2"> <label for="PhoneFax" class="Label">Fax</label> </div> <div class="fhFormRight2"> <input type="text" name="PhoneFax" id="PhoneFax" value="" size="15" onfocus="statusBarMsg('Enter a 10-digit US phone, or an International phone number starting with +.')" onblur="window.status='';" onchange="normalizedPhone = stripCharsInBag (this.value, phoneNumberDelimiters); if (isUSPhoneNumber (normalizedPhone, false)) { this.value = reformatUSPhone (normalizedPhone); }" maxlength="30" /> </div> </fieldset> <div>Briefly describe your business offerings. This information will be used as a reference by our professional marketing team to create the interactive listing copy.</div> <div> <label for="Comments" class="Label"> *Description<br />(limit 1,000 words)<br /> <textarea name="Comments" id="Comments" onfocus="statusBarMsg('Additional Comments')" onblur="window.status='';" rows="3" cols="60" onchange="limitWords(this.form.Comments, 1000);" class="required"> </textarea> </label> </div> <div> Pricing per State:<br/> $89.95 per state up to 9 states<br/> $59.95 per state up to 24 states<br/> 24 and national listings (All 50 states plus DC and Puerto Rico), $39.95 per state </p> </div> <div> <fieldset class="required"> <legend>*Check State(s) Served</legend> <?php $totalProducts = count($_post['Region']);$productPrice = 89.95;$discountfor10to24 = 30.00;$discountfor25to52 = 50.00;$discount = ($totalProducts = 10 && $totalProducts < 25) ? $discountfor10to24 : (($totalProducts > 24) ? $discountfor25to52 : 0);$total = ($productPrice * $totalProducts) - $discount;?> <table border="0" cellpadding="0"> <tr> <td><p align="center"> <input type="checkbox" name="Region[]" value="AK" /> AK<br /> <input type="checkbox" name="Region[]" value="AL" /> AL<br /> <input type="checkbox" name="Region[]" value="AR" /> AR<br /> <input type="checkbox" name="Region[]" value="AZ" /> AZ<br /> <input type="checkbox" name="Region[]" value="CA" /> CA</p></td> <td><p align="center"> <input type="checkbox" name="Region[]" value="CO" /> CO<br /> <input type="checkbox" name="Region[]" value="CT" /> CT<br /> <input type="checkbox" name="Region[]" value="DC" /> DC<br /> <input type="checkbox" name="Region[]" value="DE" /> DE<br /> <input type="checkbox" name="Region[]" value="FL" /> FL</p></td> <td><p align="center"> <input type="checkbox" name="Region[]" value="GA" /> GA<br /> <input type="checkbox" name="Region[]" value="HI" /> HI<br /> <input type="checkbox" name="Region[]" value="IA" /> IA<br /> <input type="checkbox" name="Region[]" value="ID" /> ID<br /> <input type="checkbox" name="Region[]" value="IL" /> IL</p></td> <td><p align="center"> <input type="checkbox" name="Region[]" value="IN" /> IN<br /> <input type="checkbox" name="Region[]" value="KS" /> KS<br /> <input type="checkbox" name="Region[]" value="KY" /> KY<br /> <input type="checkbox" name="Region[]" value="LA" /> LA<br /> <input type="checkbox" name="Region[]" value="MA" /> MA</p></td> <td><p align="center"> <input type="checkbox" name="Region[]" value="MD" /> MD<br /> <input type="checkbox" name="Region[]" value="ME" /> ME<br /> <input type="checkbox" name="Region[]" value="MI" /> MI<br /> <input type="checkbox" name="Region[]" value="MN" /> MN<br /> <input type="checkbox" name="Region[]" value="MO" /> MO</p></td> <td><p align="center"> <input type="checkbox" name="Region[]" value="MS" /> MS<br /> <input type="checkbox" name="Region[]" value="MT" /> MT<br /> <input type="checkbox" name="Region[]" value="NC" /> NC<br /> <input type="checkbox" name="Region[]" value="ND" /> ND<br /> <input type="checkbox" name="Region[]" value="NE" /> NE</p></td> <td><p align="center"> <input type="checkbox" name="Region[]" value="NH" /> NH<br /> <input type="checkbox" name="Region[]" value="NJ" /> NJ<br /> <input type="checkbox" name="Region[]" value="NM" /> NM<br /> <input type="checkbox" name="Region[]" value="NV" /> NV<br /> <input type="checkbox" name="Region[]" value="NY" /> NY</p></td> <td><p align="center"> <input type="checkbox" name="Region[]" value="OH" /> OH<br /> <input type="checkbox" name="Region[]" value="OK" /> OK<br /> <input type="checkbox" name="Region[]" value="OR" /> OR<br /> <input type="checkbox" name="Region[]" value="PA" /> PA<br /> <input type="checkbox" name="Region[]" value="PR" /> PR</p></td> <td><p align="center"> <input type="checkbox" name="Region[]" value="RI" /> RI<br /> <input type="checkbox" name="Region[]" value="SC" /> SC<br /> <input type="checkbox" name="Region[]" value="SD" /> SD<br /> <input type="checkbox" name="Region[]" value="TN" /> TN<br /> <input type="checkbox" name="Region[]" value="TX" /> TX</p></td> <td><p align="center"> <input type="checkbox" name="Region[]" value="UT" /> UT<br /> <input type="checkbox" name="Region[]" value="VA" /> VA<br /> <input type="checkbox" name="Region[]" value="VT" /> VT<br /> <input type="checkbox" name="Region[]" value="WA" /> WA<br /> <input type="checkbox" name="Region[]" value="WI" /> WI</p></td> <td><p align="center"> <input type="checkbox" name="Region[]" value="WV" /> WV<br /> <input type="checkbox" name="Region[]" value="WY" /> WY</p></td> </tr> </table> </fieldset> </div> <div> <input type="checkbox" name="logo" id="logo" /> Check box if to include optional logo placement $24.95 per year</div> <p> <label>Your total States = </label> <input name="totalProducts" type="text" value="" maxlength="18" /> <br /> <label>Your total order = </label> <input name="total" type="text" value="" maxlength="12" /> </p> <p align="center"> <input type="submit" name="calculate" id="submit" value="calculate" / "> <input name="Clear" type="button" value="Clear" /> <br /> </p><div class="fhFormLeft2"><label for="SecureCode" class="Label">*Anti-Spam code</label> <?php print $Error['SecureCode'] ; ?> </div> <div class="fhFormRight2"> <input type="text" name="SecureCode" id="SecureCode" value="" size="6" maxlength="6" class="required" onChange="if(isItEmpty(this.value)) {alertMsg(this.form.name,this.name,'Please enter the anti-spam code to submit this form.');}"> <?php if ($_SESSION['secureImages'] > '') { print '  ' . $_SESSION['secureImages']; } ?> <br /> </div> <div> <br /><br /> </div> <div> <label for="CC" class="Label"> <input type="checkbox" name="CC" id="CC" value="sentCarbonCopy" checked> Check here to receive a copy of this form (at the above email address). </label> </div> <div><span style="text-align: center"> <label for="Reset" class="Label"> <input type="reset" name="Reset" id="Reset" value="Clear" /> </label> <input name="Action" type="hidden" value="processForm" /> <label for="Submit" class="Label"> <input type="submit" name="Submit" id="Submit" value="Submit Form" /> </label> </span></p> </div> </form></body></html>

Link to comment
Share on other sites

There's a lot of code there, can you isolate the relevant parts? Have you set up a PayPal developer account to see what your options are?
Why do they give you form options in developer? such as checkbox states being calulated and the times by an amount and then total
Link to comment
Share on other sites

There's a lot of code there, can you isolate the relevant parts? Have you set up a PayPal developer account to see what your options are?
I just need to know how to get the check boxes to give a total amount check off and then multiply that by a price. then give total. and submit in e-mail all the info and the list of states and total price and if logo was checked. also to return the total and list of states in the next page so I can add a paypal button to pay that price for each item.
Link to comment
Share on other sites

Why do they give you form options in developer? such as checkbox states being calulated and the times by an amount and then total
No, that's just basic arithmetic. PayPal tells you how to send data to their systems and how to get data back, if you want to do that kind of thing.
how to get the check boxes to give a total amount check off
I'm not sure what that means. Have you looked into form processing with PHP? You can get every value the form sends and do whatever you want with it. You need to set up your form with the correct names and values for the various elements, get the values in PHP, and do whatever you want with them.I'm confused about what you're having problems with. Are you having problems setting up the form? Are you having problems getting the values in PHP? Are you having problems with the calculations? With the email? With PayPal? These are all separate steps, you need to take them one at a time. Each of them is easy individually, if you're trying to do everything at once it may be a little overwhelming.
Link to comment
Share on other sites

No, that's just basic arithmetic. PayPal tells you how to send data to their systems and how to get data back, if you want to do that kind of thing.I'm not sure what that means. Have you looked into form processing with PHP? You can get every value the form sends and do whatever you want with it. You need to set up your form with the correct names and values for the various elements, get the values in PHP, and do whatever you want with them.I'm confused about what you're having problems with. Are you having problems setting up the form? Are you having problems getting the values in PHP? Are you having problems with the calculations? With the email? With PayPal? These are all separate steps, you need to take them one at a time. Each of them is easy individually, if you're trying to do everything at once it may be a little overwhelming.
Lets tackle pHp is my code correct for taking the check in the check boxes and adding them then Mutiplying by a price is that part correct?
Link to comment
Share on other sites

If this is the code you're referring to:

<?php $totalProducts = count($_post['Region']);$productPrice = 89.95;$discountfor10to24 = 30.00;$discountfor25to52 = 50.00;$discount = ($totalProducts = 10 && $totalProducts < 25) ? $discountfor10to24 : (($totalProducts > 24) ? $discountfor25to52 : 0);$total = ($productPrice * $totalProducts) - $discount;?>

then I see two problems. You're using $_post instead of $_POST, and you're using = to compare in the if statement instead of ==.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...