WARNING: IF YOU READ IT CLOSELY YOU WON'T HAVE ANY ISSUES
I've wanted to help the Php/HTML section for a while, I haven't had time so I'm gonna make this quick tutorial about how to make a WORKING form that sends you the form information, its easy to understand so no one should have issues but if you have any questions or problems message me or post it here.
1. Now first you need to make a page for your form, you can get free templates by searching google "Free WebSite Templates" or "Free Designer Templates", Or just make one yourself, like I did
NOW Once you've built your form and your ready to get it ready to sent the information to your email:
3. Make a Blank page and copy and paste the following code into it:
[php]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
$body = "The following information was sent from the Contact Form:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
$send = mail($to, $subject, $body, $headers); ?>
</center>
</body>
</html>
[/php]
CUSTOMIZING IT TO FIT YOUR FORM:
At the top where it has "<meta http-equiv="refresh" content="3;URL=Index.php" />" Change 'Index.php" to whatever page or website you want them to go to after they send the message
The "$to =" you put your email there like it says then the requests under that just tells it to put the name field and email at the top of the email you get. $subject = "The subject you want the email to be"
Now the fields....You have to keep the "$fields = arry();" there but underthat you have to set up how you want to receive the email. Now...what does each thing mean?
$fields{"The name of the field you want the be there"} = "the name you want it to be called in the email:" (then the field information will go here in the email)
Now the email will be sent in the same order you line them up in, if you need to add a field just copy and paste one there and fill it out right. Then the $body = "This will show above the information in the email:\n\n" \n's are needed
$send = mail(mails it!); ?>
----------------------------------------
Now save the form page as whatever you want but it has to be .Php and the other one that sends the information as "ContactForm.php" they have to both be in the folder.
what will happen is they fill out the form, click submit, it takes them to the sent mail page it says "Message Sent!" and 3 seconds later (which should be good time to sent it) and takes them to whatever page you set there.
Good Luck,
Web-Designer
I'll make a fancy awesome, better .PDF about how to make email forms, and how to add more options like sending it to more then 1 email and so on, I'll start working on that now
Posts 1–2 of 2 · Page 1 of 1
Post a Reply
Tags for this Thread
None
Thanks, Looks Good (as a tutorial)
The Contact Form however is standard and basic (meaning it exists prior to this tutorial )