View Single Post
Old 07-03-2006   #7 (permalink)
GoldNetX
Recursively call who?
 
GoldNetX's Avatar
 
Join Date: Nov 2003
Location: Pittsburgh, PA
Posts: 294

Send a message via AIM to GoldNetX
Yeah, as Telos said, start by making sure the file is saved as .php and PHP is installed on the server. Next remove the the line:

Code:
Line 100: <form action="#" method="post">
also the submit input should have the name emailSubmit, as in:

Code:
Line 139: <input type="submit" name="emailSubmit" value="Submit" />
Now the way the php code section works is, when the user submits the form the server is going to grab the data in the fields and store that data temporarly on the server. So once it does you can then access the data on the server using the php variable $_POST. This variable is like an array where the keys are the name attributes of the form items.

So to access the data from the form you have, you would use:

$_POST['emailTo']
$_POST['name']
$_POST['address']
$_POST['city']
$_POST['state']
$_POST['age']
$_POST['comment']

So here is an example of how you could use these references to construct and email:

Code:
<?php

if ($_POST['emailSubmit']){
     $body = "The following information was just submitted by a user: \n\n Full Name: " . $_POST['name'] . "\n Address: " . $_POST['address'] . "\n City: " . $_POST['city'] . "\n State: " . $_POST['state'] . "\n Age: " . $_POST['age'] . "\n Comment: " . $_POST['comment'];
     mail($_POST['emailTo'], "Replace this with what you want the subject to be", $body);
}

?>
Then just replace the part about the subject with what you want the subject of your email to be and you should be set.
__________________

www.gusmayo.com
- Maybe a story or two -


www.jaloobie.com
... your new home ...

www.webinkproductions.com
- professional web application design -
GoldNetX is offline