adding referrer code or something to a mail handler

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
WOTek
Forum Newbie
Posts: 1
Joined: Tue Nov 09, 2004 4:41 am

adding referrer code or something to a mail handler

Post by WOTek »

im currently useing this to handle an email form..

Code: Select all

<?

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

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

$mailto = 'editied*"' ;
//$mailto = 'edited*' ;

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

$subject = "Phone Notification" ;

// 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 = "edited*" ;
$errorurl = "editied*" ;
$thankyouurl = "editied*" ;

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

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


if (!isset($_POST['email'])) {
	header( "Location: $formurl" );
	exit ;
}
if (empty($name) || empty($email) || empty($phonemodel)) {
   header( "Location: $errorurl" );
   exit ;
}

$messageproper =

	"This message was sent from:\n" .
	"$http_referrer\n" .
	"------------------------- Phone Notification Request -------------------------\n\n" .
	 "Name:" . "\n" .  $name .  "\n\n" .	
	 "Email:" . "\n" .  $email . "\n\n" .
	"Phone Model:" . "\n" . $phonemodel .  "\n\n" .
	
	"\n\n------------------------------------------------------------\n" ;

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

?>


Can i add some code instead of having $phonemodel to forward the phonemodel information from the initial phone page on to the form page an through this mail handler? right now they have to fill out thre fields id like phonemodel automaticly filled. make sence? thanx[/php_man]
Post Reply