|
|
|
|
![]() ![]() |
Oct 8 2007, 02:21 PM
Post
#1
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 20 Joined: 8-October 07 Member No.: 51,325 |
Hey guys i am new at this. i am trying to make a form and i want the form when submited go to my email adress..how can i do this? any help please...
|
|
|
|
Oct 12 2007, 09:35 PM
Post
#2
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 150 Joined: 9-April 07 From: Nebraska Member No.: 41,301 |
For something like that, you need to use php. There are a lot of tutorials on how to do different things with php, and I'm pretty sure there's one on how to do mail with it. There should be something on Google if you can't find it here.
If you're trying to test the file on your home computer, you need to have php installed(most likely with Apache). EasyPHP is the easiest way to install everything you need for php and mySql(that I know of). I've never successfully been able to get a mail form to work on my home computer, but everything works on hosted sites here, because they already have everything installed. According to http://www.freewebmasterhelp.com/tutorials/php/5 you need this: CODE <?php $to = "php@gowansnet.com"; $subject = "PHP Is Great"; $body = "PHP is one of the best scripting languages around"; $headers = "From: webmaster@gowansnet.com\n"; mail($to,$subject,$body,$headers); echo "Mail sent to $to"; ?> To set one of those variables to equal an input, just make sure everything is all in one form, make some text inputs, set their id to something useful (such as 'body') and set the form's action to be the url of your php file.(HTML and php can be in the same file. Just make sure the php is enclosed in <?php and ?> tags) Then, instead of having it be "$body = '...'", you set it to "$body = $_POST['body']"(without the double quotes) Then you can do that for whichever other variables you need. I'm not sure if you're ever supposed to set the 'from' variable for the mail function. I hope this was helpful, and if anything I've said doesn't work, either ask the other people on the forums, or Google it. |
|
|
|
Oct 13 2007, 04:26 PM
Post
#3
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 16 Joined: 13-October 07 Member No.: 51,522 |
|
|
|
|
Oct 14 2007, 12:21 PM
Post
#4
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 20 Joined: 8-October 07 Member No.: 51,325 |
Thanks very much, i really apreciate it. Now time to read about Php.
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 7th September 2008 - 03:06 AM |