Jump to content

Email Forms


The Praetorian

Recommended Posts

Okay, I have a different problem now. I've found the right code to get the form to email to me, and I've got it working, I just can't figure out how to change the form to say what I want it to say. This is how I have it now, and it emails the form to me, but in my email it shows up as From: NobodySubject: email:(the email I used)Actual message:"Name, Age, gender: Name: Me"Anyone know what I'm doing wrong?

<html><link href="layout.css" type=text/css rel=stylesheet><body><?phpif (isset($_REQUEST['email'])){$email = $_REQUEST['email'] ; $subject = $_REQUEST['Name'] ;$message = $_REQUEST['Name, Age, gender'] ;mail( "author@tsrealms.com", "email:$email", "Name: $subject", "Name, Age, gender: $message" );echo "Thank you for your application! One of the admins should be getting back to you via email within 24 hours.";}else{echo "<form class='blocktext' method='post' action='appmail.php'><br /><b>Email</b><br /><input type='text' name='email' size='20'><br /><b>Name</b><br /><input type='text' name='Name' size='20'><br /><b>~Note~</b> Leave this box blank if you'd like the writing staff to create an appropriate name for you based on your character's gender and nationality.<br /><br /><b>Age</b><br /><input type='text' name='Age' size='10'><br /><br /><b>Gender</b><br />Male: <input class='blocktext' type='radio' name='gender' value='Male'><br />Female:<input class='blocktext' type='radio' name='gender' value='Female'><br /><br /><input class='blocktext' type='submit' value='Send'><input class='blocktext' type='reset' value='Reset'></form>";  }?></body></html>

Link to comment
Share on other sites

you see this line?mail( "author@tsrealms.com", "email:$email", "Name: $subject", "Name, Age, gender: $message" );see anything familiar about it and the email you receive?what do you want the email to say exactly?and i cant see any 'message' box in your form for people to send you a message..

Link to comment
Share on other sites

well..you need to create different variables for each field.take the variables already there such as$subject = $_REQUEST['Name'] ;and create some for age, gender, message etc..then, you need to add the name attribute into the form for the php to process the right information.then add $variablename into that line i said above, for it to appear in the email.just remember that it is case sensitive.and i'm sure that the attributes inside the form html has to be in " and not '

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...