I have been banging away at this for ages ans haven't been able to get this to work.
I'm a full time Paramedic and a parttime Photographer who has run out of time and patience trying to get this working so any help will be greatly appreciated...
I'm trying to get the user to enter a 'code' before the form is submitted, to reduce the level of spam I've been bombed with...
🙂 You make it work I'll but you a beer!!! 😃
<?
function test_order($sal, $who, $email, $street1, $suburb, $state, $postcode, $phone1, $phone2, $type, $comment) {
$subject="PSPWA.COM = Contact Form";
$Info = "\n";
$Info .= "\n";
$Info .= "Contact Name: $sal. $who \n";
$Info .= "\n";
$Info .= "Email Address: $email \n";
$Info .= "\n";
$Info .= "Address: $street1 \n";
$Info .= "Address: $suburb, \n";
$Info .= "Address: $state, $postcode \n";
$Info .= "\n";
$Info .= "Home - $phone1 \n";
$Info .= "Mobile - $phone2 \n";
$Info .= "\n";
$Info .= "\n";
$Info .= "Type of contact - [ $type ] \n";
$Info .= "============================================\n";
$Info .= "Comments: \n $comment \n";
$Info .= "============================================\n";
//insert the other approrpriate fields you want displayed here
//ensure you specify your email addres below
mail("xxxxx@xxxxxx.xxx.xx", $subject, ".$Info.", "From: ".$email."\nReply-To: ".$$email."\nReturn-Path: ".$$email);
}
?>
<html>
<body bgcolor="#DFDFDF">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2" height="62">
<tr>
<td width="100%" height="62" bgcolor="#8795F8">
<p align="center"><b><font face="Monotype Corsiva" size="7" color="#FF0000">P</font></b><font face="Monotype Corsiva" size="6">erth</font><b><font face="Monotype Corsiva" size="7">
<font color="#FF0000">S</font></font></b><font size="6">ports</font><font size="7">
<b>
<font face="Monotype Corsiva" color="#FF0000">P</font></b></font><font size="6">hotography</font><b><font face="Times New Roman"><sub><font size="4">(WA)</font></sub></font></b></p>
</td>
</tr>
</table>
<p></p>
<p></p>
<p align="center"><u><b><font size="3">
<font face="Raavi">
[ <a href="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">Home</a> ]
[ <a href="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">Gallery </a>]
[<a href="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">Pricing</a> ]
[<a href="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</a>]
</font></p></b></u>
<p></p>
<?php if (!$form_send == "sent") { ?>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-width: 0" bordercolor="#111111" width="100%" id="AutoNumber1">
</table>
<?php if ($security = yellow) { ?>
<form method="post" action="contact.php?form_send=true">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-width: 0" bordercolor="#111111" width="100%" id="AutoNumber2">
</table>
<TABLE cellSpacing=2 cellPadding=2 width=600 align=center border=0>
<TR vAlign=center>
<TH align=left colSpan=2 bgcolor="#8795F8">
<p align="center"><font size="4">:: Contact Details ::</font></TH></TR>
<TR vAlign=center>
<TD align=right width=350><LABEL for=name>Salutation</LABEL></TD>
<TD width=300><select name=sal><OPTION selected></OPTION>
<option>Mr.</option>
<option>Mrs</option>
<option>Miss</option>
<option>Ms</option>
</select></TD></TR>
<TR vAlign=center>
<TD align=right width=350><LABEL for=name>Name *</LABEL></TD>
<TD width=300><INPUT name=who size="30" ></TD></TR>
<TR vAlign=center>
<TD align=right width=350><LABEL for=name>E-mail *</LABEL></TD>
<TD width=300><INPUT name=email size="30"></TD></TR>
<TR vAlign=center>
<TD align=right width=350><LABEL for=name>Address</LABEL></TD>
<TD width=300><INPUT name=street1 size="20"></TD></TR>
<TR vAlign=center>
<TR vAlign=center>
<TD align=right width=350><LABEL for=name>Suburb</LABEL></TD>
<TD width=300><INPUT name=suburb size="20"></TD></TR>
<TR vAlign=center>
<TD align=right width=350><LABEL for=name>State</LABEL></TD>
<TD width=300><select name=state ><OPTION selected>WA</OPTION>
<option>ACT</option>
<option>NSW</option>
<option>NT</option>
<option>QLD</option>
<option>SA</option>
<option>TAS</option>
<option>VIC</option>
</select></TD></TR>
<TR vAlign=center>
<TD align=right width=350><LABEL for=name>Postcode</LABEL></TD>
<TD width=200><INPUT name=postcode size="10"></TD></TR>
<TR vAlign=center>
<TD align=right width=350><LABEL for=name>Daytime Phone</LABEL></TD>
<TD width=300><INPUT name=phone1 size="30"></TD></TR>
<TR vAlign=center>
<TD align=right width=350><LABEL for=name>Mobile Phone</LABEL></TD>
<TD width=300><INPUT name=phone2 size="30"></TD></TR>
<table width="600" align="center" border="0">
<tr vAlign="center">
<th align="middle" colSpan="2" bgcolor="#8795F8" width="594"><font size="4">:: Your Message ::
</font> </th></tr>
<p></p>
<p></p>
<TR vAlign=center>
<TD width=594 colspan="2"><select name=type><OPTION selected>General Enquiry</OPTION>
<option>Make a Booking</option>
<option>Enquire about a recent Booking</option>
<option>Just to say HELLO</option>
</select></TD></TR>
<TR vAlign=center>
<TABLE cellSpacing=0 cellPadding=0 align=center border=0>
<TBODY>
<TR><p><strong></strong><br>
<textarea name="comment" rows="10" cols="60"></textarea></p>
<p></p>
<p></p>
<TR vAlign=center>
<TD align=right width=121 bgcolor="#FFFF00" bordercolorlight="#FF0000" bordercolordark="#FF0000">
<p align="center">Type the colour of <i><b>this </b></i>box below
<INPUT name="security" type="text" size="20"></TD></TR>
<p></p>
<p></p>
<TD align=right><INPUT type=submit value=Submit name=Submit> </TD>
<TD align=left><INPUT type=reset value=Reset name=Reset>
</TD></TR></TBODY></TABLE>
</table>
</form>
<!--RiteCounter--><script type="text/javascript" src="http://www.ritecounter.com/c/38/37419.js"></script><noscript>
<a href="http://www.ritecounter.com"><img src="http://www.ritecounter.com/scripts/htmlc.php?id=37419" alt="HTML Visitor Counter" border=0></a></noscript><!--END RiteCounter-->
<p align="center"><img border="0" src="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" width="600" height="421"></p>
<p align="center"><strong><font face="Monotype Corsiva" size "7">"Speed Ball"</p>
<?php } else { ?>
<? test_order( $sal, $who, $email, $street1, $suburb, $state, $postcode, $phone1, $phone2, $type, $comment)
//name and address5 are the name and email address accordingly
//when page submits, it will show this part ?>
<p></p>
<p></p>
<p></p>
<p></p>
<p align="center"><strong><font color="#0000FF" size="4">[ Form Submitted ]</font></strong></p>
<p></p>
<p align="center">Thank You</p>
<p></p>
<p align="center">We will contact you shortly with a reply...</p>
<p></p>
<p align="center">To return to our webpage...Simply hit your browser's "Back Button"</p>
<p></p>
<p></p>
<p align="center"><img border="0" src="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" width="800" height="623"></p>
<p align="center"><strong><font face="Monotype Corsiva" size "6">"Lone Rider"</p>
</font></strong></font></strong></font>
<?php } ?>
</html>