...

View Full Version : Resolved mailing "$var" in $var =



Pantheon8
08-10-2009, 03:29 PM
I am having a ton of trouble trying to mail the data that was entered into a form using $variables inside another $variable's quotes. It will mail the typed text but will not display the variable in the mail message that it received. Here is the code, all the other codes are fine but this one php page....




<?php
$to = "pantheon8@maximized.org";
$subject = "Error Report";
$email = "error_report" ;
$message = "From: $message1
Type of Issue: $message2
Message: $message3 \n";
$message1 = $_REQUEST['email'];
$message2 = $_REQUEST['type'];
$message3 = $_REQUEST['message'];
$headers = "From: $message1";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>



Please Help :confused:

-Pantheon8

kbluhm
08-10-2009, 03:31 PM
Quite obvious, the variables do not exist yet. You are defining $message1, $message2, etc, after including them in the previous string.

Pantheon8
08-10-2009, 03:35 PM
omg... I feel so dumb...

atleast now i know! Its kinda like the order the <tr> and <td> have to be in a table...

Thanks sooo much!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum