Hi,
I am a beginner in php. I speak little english I got the the script on form to email but I have problems with him. Please help with that?
- Form are uploaded but immediately sends unfilled on email.
- Immediately after loaded and sent to the e-mail page appears thanking although has not been filled. Is perhaps a better to control of
fulfillment of important data ? - How to do after sending the form redirection to the new webpage with the results:
a) Form was sent - web page I have already made - the need to insert link to a php.
b) Error + error list - web page I have already made - the need to insert link to a php.
Thank you all in advance for your help with the addition of a script !!!
I enclose a script:
[php]
<?php $EmailFrom = "info@my mail.co.uk"; $EmailTo = "info@my mail.co.uk"; $Subject = "Info"; $Name = Trim(stripslashes($_POST['Name'])); $Email = Trim(stripslashes($_POST['Email'])); $Message = Trim(stripslashes($_POST['Message'])); $validationOK=true; if (!$validationOK) { echo "please check your details"; header("Location: http://my webpage/testform.php"); exit; } $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Message: "; $Body .= $Message; $Body .= "\n"; $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); if ($success){ print ""; } else{ print ""; } ?><form action="testform.asp" method="post">
| Name: | |
|---|---|
| Email Address: | |
| Comments: | |
| To prevent spam, please enter the text from the following picture: |
[/php]