Jump to content

PHP email form


dgow13

Recommended Posts

I have 2 questions. I am new to php programming. I watched the beginner tutorials for php, followed the samples, designed a contact form & thank you page and then sent everything to my email. Everything went just fine. In my email all the information showed up except the radio button and drop down list info. I have no idea how to get that information to send. Any suggestions?

 

Also, How can I structure the contact form, once it shows up in my email, to be organized as follows:

 

Name: Name text

Email: Email text

Phone: Phone text

Comments: Text... and so on?

 

I appreciate your help.

Link to comment
Share on other sites

Your PHP mail code needs something like:-

mail( $admin, "Form Feedback: $subject", "$name\n\r$email\n\r$phone\n\r$comments", "From: $name " );

 

where the \n makes the text start a new line and \r means carriage return (a hangover from type writers and as far as I know do the same thing, using only \n seems to work) and $name is the variable relating to the form field name="name"

 

$name = remove_headers($_POST['name']) ;

Edited by Wickham
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...