View Single Post
Old 07-13-2005, 07:37 AM   #2 (permalink)
Rawan AbuSalman
 
Super Techie

Join Date: Mar 2005

Posts: 457

Rawan AbuSalman

Default

This is the HTML Code of the form that corresponds to the php script


Code:
<form action="feedback.php" method="post">
<table border="0" cellpadding="8" cellspacing="8" summary="feedback form">
<tr><td>Name:</td><td><input type="text" name="name" size="25" /></td></tr>
<tr><td>Email address:</td><td><input type="text" name="email" size="25" /></td></tr>
<tr>
<td colspan="2">
Comments

<textarea rows="15" cols="45" name="comments">
</textarea>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" value="Send Feedback" />

Powered by thesitewizard.com
</td>
</tr>
</table>
</form>


The php script I got is: (it is for another form not the one I created)


Code:
*/

// ------------- CONFIGURABLE SECTION ------------------------

// $mailto - set to the email address you want the form
// sent to, eg
//$mailto		= "youremailaddress@example.com" ;

$mailto = 'rabusalman07@ic.edu.lb' ;

// $subject - set to the Subject line of the email, eg
//$subject	= "Feedback Form" ;

$subject = "Order" ;

// the pages to be displayed, eg
//$formurl		= "http://www.example.com/feedback.html" ;
//$errorurl		= "http://www.example.com/error.html" ;
//$thankyouurl	= "http://www.example.com/thankyou.html" ;

$formurl = "order.htm" ;
$errorurl = "error.htm" ;
$thankyouurl = "thanx.htm" ;

// -------------------- END OF CONFIGURABLE SECTION ---------------

$name = $_POST['name'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );

if (!isset($_POST['email'])) {
	header( "Location: $formurl" );
	exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
   header( "Location: $errorurl" );
   exit ;
}
$name = strtok( $name, "\r\n" );
$email = strtok( $email, "\r\n" );
if (get_magic_quotes_gpc()) {
	$comments = stripslashes( $comments );
}

$messageproper =

	"This message was sent from:\n" .
	"$http_referrer\n" .
	"------------------------- COMMENTS -------------------------\n\n" .
	$comments .
	"\n\n------------------------------------------------------------\n" ;

mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\r\nReply-To: \"$name\" <$email>\r\nX-Mailer: chfeedback.php 2.04" );
header( "Location: $thankyouurl" );
exit ;

?>

__________________

Intel Core 2 Quad 2.4 Ghz
4 GB RAM
500 GB HD
512 MB ATI HD 2600 Pro
32" Samsung LCD
Windows Vista Ultimate
------------------------------------------------
HP Pavilion dv2000, Core 2 Duo 2.0 GHz
2 GB RAM
160 GB HD
DVD RW LightScribe
383 MB nVidia Graphics
1.3 MP Web Cam/ Fingerprint/ Bluetooth
Windows Vista Home Premium
Rawan AbuSalman is offline