I am getting data through Second Life to a PHP script and the PHP script is sending the data through an email.
My question is how to get the time (which is the variable $time) into the subject line of the email. Right now, it is just ignoring the variable $time.
Here is that part of my code:
$time = $_POST["time"];
$log = $_POST["log"];
$to = "OSU@gmail.com";
$subject = <<<TEST
New Visitor; VDC2; $time
TEST;
$theMes = <<<TEST
Visitor Log for VDC2:
$log
TEST;
$headers = 'From: TecEdgeDL@gmail.com' . "\r\n" .
'Message-Id: TecEdgeDL@gmail.com' . "\r\n" .
'Reply-To: TecEdgeDL@gmail.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $theMes, $headers);
Why don’t you write the $subject variable like this instead?
And while you’re at it, write $theMes like this:
If that doesn’t work try encoding the content. I still don’t know why it wouldn’t display but this might be worth a shot since mail does encode.
There could be something with the semicolons or timestamp that’s confusing PHP.