I'm fairly new at creating php forms. I have a form which currently allows the entered data to be sent to MySQL database and also sent to an email address. At this time after the form is completed, clients are being sent to a payment page. However, I want the form to allow those clients that do not choose to purchase a logo or Ad to be redirected to a "thank you " page instead. So in other words, if both the radio button for Logo and Ad are checked as "NO" they shouldn't be sent to the payment form but instead a thank you page. I am not sure how to do this with an IF statement.
My code is here:
<form action="/insert.php" method="post">
<input type="hidden" name="good_url"
value="http://www.mdna.com/directory_payment.html" />
<input type="hidden" name="subject" value="Directory Form Submission" />
<input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER" />
<input type="hidden" name="recipients" value="jkesselring@mdna.com" />
<input type="hidden" name="required" value="companyname:Company Name,address:Company Address,city:City,state:State,zip:Postal Code,country:Country,tel:Telephone,fax:Fax,email:E-Mail Address,url:Internet URL" />
<input type="hidden" name="derive_fields" value="email=email,realname=company" />
<input type="hidden" name="mail_options" value="Exclude=email;realname" />
<table border="1" cellspacing="5%" style="font-family: Arial, Helvetica, sans-serif; width: 905px;">
<tr>
<td colspan="2">
<b>FREE ALPHABETICAL ENTRY (required)</b></td>
</tr>
<tr>
<td style="width: 433px">
<p>Company Name:</p>
</td>
<td><input type="text" name="companyname" />
</td>
</tr>
<tr>
<td style="width: 433px">
<p>Address:</p>
</td>
<td><input type="text" name="address" />
</td>
</tr>
<tr>
<td style="width: 433px">
<p>City:</p>
</td>
<td><input type="text" name="city" />
</td>
</tr>
<tr>
<td style="width: 433px">
<p>State/Province:</p>
</td>
<td><input type="text" name="state" />
</td>
</tr>
<tr>
<td style="width: 433px">
<p>Postal Code:</p>
</td>
<td><input type="text" name="zip" />
</td>
</tr>
<tr>
<td style="width: 433px">
<p>Country:</p>
</td>
<td><input type="text" name="country" />
</td>
</tr>
<tr>
<td style="width: 433px">
<p>Telephone:</p>
</td>
<td><input type="text" name="tel" />
</td>
</tr>
<tr>
<td style="width: 433px">
<p>Fax:</p>
</td>
<td><input type="text" name="fax" />
</td>
</tr>
<tr>
<td style="width: 433px">
<p>E-Mail:</p>
</td>
<td><input type="text" name="email" />
</td>
</tr>
<tr>
<td style="width: 433px">
<p>Internet URL:</p>
</td>
<td><input type="text" name="url" />
</td>
</tr>
<tr>
<td colspan="2" style="font-weight: 700">LOGO AND ADVERTISEMENT PLACEMENT ORDERS (optional)</td>
</tr>
<tr>
<td style="width: 433px"><p style="margin-bottom: 0px"><b>Logo Placement:</b></p>
<p style="margin-top: 0px; margin-bottom: 0px"><b>US$250.00</b></p>
<p style="margin-top: 0px">4-color process</p>
</td>
<td>
Yes <input type="radio" name="logo" value="Yes Logo" />
No <input type="radio" name="logo" value="No Logo" />
</td>
</tr>
<tr>
<td style="width: 433px"><p style="text-align: right">If you requested Logo Placement, indicate submission option:</p>
</td>
<td>
<input type="checkbox" name="logoemail" value="Will email the Logo" />Email the print material to jkesselring@mdna.com
<br />
<input type="checkbox" name="logosend" value="Will send the Logo" />Send digitalized data on diskette along with hard copy<br />
<span class="style2">Material required: Logo digitalized on diskette
along with a hard copy
of the logo OR the logo emailed to
</span>
<a href="mailto:jkesselring@mdna.com">
<span class="style2">jkesselring@mdna.com</span></a><span class="style2">in MAC-format or as .gif, .tif, or .jpg file (300 dpi), along with a .pdf
version, letters in splines. </span>
</td>
</tr>
<tr>
<td style="width: 433px"><p style="margin-bottom: 0px"><b>Advertising Placement
(4-color process):</b></p>
<p style="margin-top: 0px; margin-bottom: 0px; font-weight: 700;">1/2 Page Advertisement =
<b>US$850</b></p>
<p style="margin-top: 0px; margin-bottom: 0px; font-style: italic; font-size: small;">1/2 page horizontal, 4-color process: 7 1/2" X 5" non bleed, or 8 3/4" X 5 3/4" bleed<br />
1/2 page vertical, 4-color process: 3 5/8" X 10" non bleed, or 4 1/2" X 11" bleed</p>
<p style="margin-top: 0px; margin-bottom: 0px; font-weight: 700;">1/1 Page Advertisement =<b>
US$1,200</b></p>
<p style="margin-top: 0px; font-style: italic; font-size: small;">(inside covers and back page upon quotation)<br />
1/1 page; 4-color process.: 7 1/2" X 10" non bleed, or 8 5/8" X 11" bleed</p>
</td>
<td>
Yes - 1/2 Page Ad <input type="radio" name="ad" value="Yes, Half Ad" />
<br />
Yes - 1/1 Page Ad <input type="radio" name="ad" value="Yes, Full Ad" />
<br />
No <input type="radio" name="ad" value="No Ad" />
</td>
</tr>
<tr>
<td style="width: 433px"><p style="text-align: right">If you requested Ad Placement, indicate submission option:</p>
</td>
<td>
<input type="checkbox" name="ademail" value="Will Email Ad" />Email the print material to jkesselring@mdna.com
<br />
<input type="checkbox" name="adsend" value="Will Send Ad" />Send digitalized data on diskette along with hard copy
<br />
<span class="style2">Material required: Logo digitalized on diskette
along with a hard copy
of the logo OR the logo emailed to
</span>
<a href="mailto:jkesselring@mdna.com">
<span class="style2">jkesselring@mdna.com</span></a><span class="style2">in MAC-format or as .gif, .tif, or .jpg file (300 dpi), along with a .pdf
version, letters in splines. </span>
</td>
</tr>
<tr>
<td style="width: 433px"><input type="submit" value="Submit" /></td>
<td style="text-align:right;"> </td>
</tr>
</table>
</form>