[Tutorial] Mailto:Your email Forms :D (PHP)
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
Once you got your page ready to make the form....
2. make your form xD
Heres my contact form I made:
Simple Name, Email, Message Contact form. You can put it into your own table or whatever you'd like.
The start of the form has to stay the same but you can add as many or whatever kind of form items you want, heres a list of different items:
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">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="3;URL=Index.php" />
<title>Sendemail Script</title>
</head>
<body>Message Sent!
<?php
$to = "Your email Goes Here" ;
$name = $_REQUEST['name'] ;
$headers = $_REQUEST['email'] ;
$subject = "Contact Form";
$fields = array();
$fields{"name"} = "Name:";
$fields{"email"} = "Email:";
$fields{"message"} = "Message:";
$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
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

Once you got your page ready to make the form....
2. make your form xD
Heres my contact form I made:
Code:
<form action="ContactForm.php" method="post">
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>
<input type="hidden" name="ip" value="<?php echo $ipi ?>" /> <!-- Get there IP Address -->
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
<div>
<label for="name">Your name...</label>
<input type="text" name="name" class="text_form required" id="name" value="" />
</div>
<div>
<label for="email">Your e-mail address...</label>
<input type="text" name="email" class="text_form required email" id="email" value="" />
</div>
<div>
<label for="message">Your message...</label>
<textarea cols="40" rows="8" name="message" class="required" id="message"></textarea>
</div>
<div>
<input class="submit" type="submit" value="Send message" />
<div id="loader"></div><span id="result"></span>
</div>
</form>
The start of the form has to stay the same but you can add as many or whatever kind of form items you want, heres a list of different items:
- Text Box: <input name="TextBox" type="text" size="200" />
- Text Area (Multi-Line Text Box): <textarea name="Textarea" cols="100" rows="6"></textarea>
- Check Box: <input name="CheckBox" type="checkbox" value="" checked />
- 3 Radio things:
<p>
<label>
<input type="radio" name="Radio" value="Choice1" id="Radio_0" />
Choice1</label>
<br />
<label>
<input type="radio" name="Radio" value="Choice2" id="Radio_1" />
Choice2</label>
<br />
<label>
<input type="radio" name="Radio" value="Choice3" id="Radio_2" />
Choice3</label>
<br />
</p>
- Submit Button: <input name="Submit" type="submit" value="Submit" />
- Reset Form Button: <input name="reset" type="reset" value="reset" />
- Password Field: <input name="passwd" type="password" value="" size="100" maxlength="20" />
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">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="3;URL=Index.php" />
<title>Sendemail Script</title>
</head>
<body>Message Sent!
<?php
$to = "Your email Goes Here" ;
$name = $_REQUEST['name'] ;
$headers = $_REQUEST['email'] ;
$subject = "Contact Form";
$fields = array();
$fields{"name"} = "Name:";
$fields{"email"} = "Email:";
$fields{"message"} = "Message:";
$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

)