<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=US-ASCII" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18904"></HEAD>
<BODY style="FONT-FAMILY: Arial; COLOR: #000000; FONT-SIZE: 10pt" id=role_body bottomMargin=7 leftMargin=7 rightMargin=7 topMargin=7><FONT id=role_document color=#000000 size=2 face=Arial>
<DIV>Hi</DIV>
<DIV> </DIV>
<DIV>I have the following php script to process an email form, however in the
from field of the email recieved how can I get it to display the users
email? At present it just says web <A href="mailto:enquiry@webhost.com">enquiry@webhost.com</A> ?</DIV>
<DIV> </DIV>
<DIV>Any ideas would be most welcome, and would be interested in learning on how
the form could be made more secure (as at present the server side validation is
not working) and streamlined. I have looked through the W3 schools
site but would appreciate an expert opinion on the best approach.</DIV>
<DIV> </DIV>
<DIV>---------------- SCRIPT---------------------</DIV>
<DIV><?php<BR>// email Contact Form Generator <BR>// <A href="http://www.tele-pro.co.uk/scripts/contact_form/">http://www.tele-pro.co.uk/scripts/contact_form/</A>
<BR>// This script is free to use as long as you <BR>// retain the credit
link </DIV>
<DIV> </DIV>
<DIV>// get posted data into local variables<BR>$EmailFrom = "Web
Enquiry";<BR>$EmailTo = "myemail@domain.com;<BR>$Subject = "Web
Enquiry";<BR>$name = Trim(stripslashes($_POST['name'])); <BR>$tel =
Trim(stripslashes($_POST['tel'])); <BR>$email =
Trim(stripslashes($_POST['email'])); <BR>$comment =
Trim(stripslashes($_POST['comment'])); </DIV>
<DIV> </DIV>
<DIV>// validation<BR>//$validationOK=true;<BR>//if (Trim($name)=="")
$validationOK=false;<BR>//if (Trim($email)=="") $validationOK=false;<BR>//if
(Trim($comment)=="") $validationOK=false;<BR>//if (!$validationOK) {<BR>//
print "<meta http-equiv=\"refresh\"
content=\"0;URL=contactus1.html\">";<BR>// exit;<BR>//}</DIV>
<DIV> </DIV>
<DIV>// prepare email body text<BR>$Body = "";<BR>$Body .= "Name: ";<BR>$Body .=
$name;<BR>$Body .= "\n";<BR>$Body .= "Telephone Number: ";<BR>$Body .=
$tel;<BR>$Body .= "\n";<BR>$Body .= "Email Address: ";<BR>$Body .=
$email;<BR>$Body .= "\n";<BR>$Body .= "Web Enquiry: ";<BR>$Body .=
$comment;<BR>$Body .= "\n";</DIV>
<DIV> </DIV>
<DIV>// send email <BR>$success = mail($EmailTo, $Subject, $Body, "From:
<$EmailFrom>");</DIV>
<DIV> </DIV>
<DIV>// redirect to success page <BR>if ($success){<BR> print "<meta
http-equiv=\"refresh\"
content=\"0;URL=thankyou.html\">";<BR>}<BR>else{<BR> print "<meta
http-equiv=\"refresh\"
content=\"0;URL=contactus1.html\">";<BR>}<BR>?></DIV>
<DIV> </DIV>
<DIV> </DIV></FONT></BODY></HTML>