The Praetorian Posted May 22, 2006 Share Posted May 22, 2006 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 More sharing options...
real_illusions Posted May 22, 2006 Share Posted May 22, 2006 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 More sharing options...
The Praetorian Posted May 22, 2006 Author Share Posted May 22, 2006 Well, I don't actually want the form to be in the format of an email. Ideally, I want it to have multiple fields like Name, Gender, Age, Location, Email, and so on. As well as a text box. And then have all that information sent to me once they hit submit. Link to comment Share on other sites More sharing options...
real_illusions Posted May 22, 2006 Share Posted May 22, 2006 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 More sharing options...
reportingsjr Posted May 22, 2006 Share Posted May 22, 2006 what is the $_REQUEST[] array? Ive never seen that global.. use $_POST[] for forms.. or $_GET[]I dont see anything wrong with it.. Link to comment Share on other sites More sharing options...
real_illusions Posted May 22, 2006 Share Posted May 22, 2006 what is the $_REQUEST[] array? Ive never seen that global.. use $_POST[] for forms.. or $_GET[]<{POST_SNAPBACK}> i was thinking that too...but i dont know what request did..so i presume it was ok to use. i've only used $_post before on email forms. Link to comment Share on other sites More sharing options...
scott100 Posted May 23, 2006 Share Posted May 23, 2006 This problem was solved earlier on: http://w3schools.invisionzone.com/index.ph...wtopic=4863&hl= what is the $_REQUEST[] array?<{POST_SNAPBACK}> $_REQUEST[] can be used to get the result from both HTTP GET and HTTP POST Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now