If you copy and paste everything I've posted (and edit the you@address.com part in the mail() function), and save it as "anything.php" and run it on your site, you'll see what the code does.
[J]ona
Visit Slightly Remarkable to see my portfolio, resumé, and consulting rates.
How would I fit other stuff like a checkbox, textarea, etc... what would I have to do from this:
mail("webmaster@crosspoint.org", "Subject - Feedback", "Someone submitted the form on your site. They put in this:\n\n".$_POST["fieldName"], "From: crosspoint.org");
Would I just type that echo $_POST[fieldname] again?
AND how come there are 3 pages on one page?
----This is really helping... just to let you know
PYRO---
How do you work your php script?
WARNING: non-exposure to the Son can cause burning!
Originally posted by Jonathan PYRO---
How do you work your php script?
Please ask a more specific question. I don't know what part you do not understand. What you do is take the script I linked to, change the info in the top to be what you want, save it as mailer.php (or anything with a .php extention) and link to it in your forms action.
The first if statement is a test to see which command to execute: display the form, or process the form? If the form hasn't been submitted, then you can't process it, but if the form has been submitted, then you can. So, instead of checking to see if(isset($_POST["fieldName"]), we check to see if the query string is nothing. If it is, display the HTML form, if it's not, process the form. That is why I have the action="thephpPage.php?node=process" on it. If I took that off, it wouldn't process the PHP, it'd just show the form again. This also explains the, "three pages on one page." (Which, actually, it's two pages. )
Adding form elements is done in the same way the first one is done. You add HTML elements to the first part of the PHP code--the one that displays the form--and you name them whatever you like. Then you call them with $_POST["nameOfTheField"] and you can add them to your email and echo them to the next page at will. (This also answers your "third" question.)
[J]ona
Visit Slightly Remarkable to see my portfolio, resumé, and consulting rates.
Bookmarks