manu_ghimire Posted March 28, 2007 Share Posted March 28, 2007 hello i just got this code for mailing the form data to email i am having mulptipe fileds in form other then subject message look at the code <form method=post action=mailtest.php> First Name <input type=text name=firstName> Favorite Food <input type=text name=favoritefood> Hobby<input type=text name=hobby> email<input type=text name=email> <input type=submit> </form> ] now mailtest.php <? $body = "Someone submitted the following information from our Astromatch form. First Name: $firstname Favorite food: $favoritefood Hobby: $hobby email: $from "; $from=$_POST['email']; mail("manu_ghimire@yahoo.com", "hello", $body ,"From: $from\n"); ?> email sent successfully! now problem here is i am able to recieve the email successflly but the problem is the fileds inside the body which are firstname fav food hobby are not there in email email recieved is like this ------- Firstname : favfood: hobby: thanx for paying attention kindly tell me where should i make the changes Quote Link to comment Share on other sites More sharing options...
mahe2310 Posted March 28, 2007 Share Posted March 28, 2007 Use $_POST['xx'] instead of $xx in the body. Quote Link to comment Share on other sites More sharing options...
Greaser9780 Posted March 28, 2007 Share Posted March 28, 2007 You have varibles listed but don't say they are equal to what was posted so $firstname = $_POST['firstname']; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.