Hi Ian,<div><br></div><div>I don&#39;t mind writing a little PHP script if it helps - shall I send to your aol account? I&#39;ll do this in the next day or so and you can ask any questions that you may have.<br><br><div class="gmail_quote">

On Tue, Oct 13, 2009 at 8:13 PM, David Goodwin <span dir="ltr">&lt;<a href="mailto:david@codepoets.co.uk">david@codepoets.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi Ian,<br>
<div class="im"><br>
&gt; // get posted data into local variables<br>
</div>&gt; $EmailFrom = &quot;_idvaughan@aol.com_ (mailto:<a href="mailto:idvaughan@aol.com">idvaughan@aol.com</a>) &quot;;<br>
&gt; $EmailTo = &quot;_idvaughan@aol.com_ (mailto:<a href="mailto:idvaughan@aol.com">idvaughan@aol.com</a>) &quot;;<br>
<div class="im">&gt; $Subject =  &quot;Enquiry&quot;;<br>
&gt; $Name = Trim(stripslashes($_POST[&#39;Name&#39;]));<br>
&gt; $Tel =  Trim(stripslashes($_POST[&#39;Tel&#39;]));<br>
&gt; $email =  Trim(stripslashes($_POST[&#39;email&#39;]));<br>
&gt; $message =  Trim(stripslashes($_POST[&#39;message&#39;]));<br>
&gt;<br>
<br>
</div>The stripslashes and trims are unnecessary. Unless you have<br>
magic_quotes turned on, in which case you might find the generated<br>
email gets filled with \&#39;<br>
<br>
You&#39;d be best off performing some sort of regular expression match -<br>
or using the filter extension ...<br>
<br>
$email = filter_var($_POST[&#39;email&#39;], FILTER_VALIDATE_EMAIL);<br>
if(!$email) {<br>
        // invalid email address<br>
}<br>
(Requires PHP5, I think my syntax/usage is correct, but I&#39;ve not<br>
checked it)<br>
<div class="im"><br>
&gt; // validation<br>
&gt; //$validationOK=true;<br>
&gt; //if (Trim($Name)==&quot;&quot;)  $validationOK=false;<br>
&gt; //if (Trim($email)==&quot;&quot;) $validationOK=false;<br>
&gt; //if  (Trim($message)==&quot;&quot;) $validationOK=false;<br>
&gt; //if (!$validationOK) {<br>
&gt; //   print &quot;&lt;meta http-equiv=\&quot;refresh\&quot;<br>
&gt; content=\&quot;0;URL=contactus1.html\&quot;&gt;&quot;;<br>
&gt; //  exit;<br>
&gt; //}<br>
&gt;<br>
<br>
</div>I prefer :<br>
<br>
header(&#39;Location: &#39; . $url);<br>
exit(0);<br>
<br>
- instead.<br>
<div class="im"><br>
&gt; // prepare email body text<br>
&gt; $Body = &quot;&quot;;<br>
&gt; $Body .= &quot;Name: &quot;;<br>
&gt; $Body .=  $Name;<br>
&gt; $Body .= &quot;\n&quot;;<br>
&gt; $Body .= &quot;Tel: &quot;;<br>
&gt; $Body .= $Tel;<br>
&gt; $Body .=  &quot;\n&quot;;<br>
&gt; $Body .= &quot;email: &quot;;<br>
&gt; $Body .= $email;<br>
&gt; $Body .= &quot;\n&quot;;<br>
&gt; $Body .=  &quot;message: &quot;;<br>
&gt; $Body .= $message;<br>
&gt; $Body .= &quot;\n&quot;;<br>
&gt;<br>
&gt; // send email<br>
&gt; $success = mail($EmailTo, $Subject, $Body, &quot;From:  &lt;$EmailFrom&gt;&quot;);<br>
<br>
<br>
</div>If you&#39;re using an &#39;old&#39; version of php this may be vulnerable to mail<br>
header injection, before 5.2.3 (I think)<br>
As a rule try to avoid calling the mail() function directly and<br>
instead use one of hte many higher level APIs - like for instance<br>
PEAR_Mail, Zend_Mail, SwiftMailer etc etc<br>
<br>
<br>
thanks<br>
David.<br>
<font color="#888888"><br>
--<br>
David Goodwin<br>
<br>
[ david at codepoets dot co dot uk ]<br>
[ <a href="http://www.codepoets.co.uk" target="_blank">http://www.codepoets.co.uk</a>       ]<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Phpwm mailing list<br>
Website : <a href="http://www.phpwm.org" target="_blank">http://www.phpwm.org</a><br>
Twitter : <a href="http://www.twitter.com/phpwm" target="_blank">http://www.twitter.com/phpwm</a><br>
Facebook: <a href="http://www.facebook.com/group.php?gid=2361609907" target="_blank">http://www.facebook.com/group.php?gid=2361609907</a><br>
<br>
Post to list: <a href="mailto:Phpwm@mailman.lug.org.uk">Phpwm@mailman.lug.org.uk</a><br>
Archive etc : <a href="https://mailman.lug.org.uk/mailman/listinfo/phpwm" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/phpwm</a><br>
</div></div></blockquote></div><br></div>