...

View Full Version : script error



andrew1234
06-29-2005, 09:41 PM
Hi this script used to work
but it does not work.. can you please help me correct it...

thanks

Andrew

<?
//echo "Title[$Title]";
$txtTo = "info@thet.co.za,te@t.co.za,om@hot.com";
$txtFrom = "info@test.co.za";
$subject = "test";
$header = " \n\n";
$footer = " \n";


// continue with rest of form...
$message .= "Name : $name \n\n";
$message .= "E-mail : $email \n\n";
$message .= "Telephone : $code $tel \n\n";
$message .= "Question : $textarea \n\n";



mail ($txtTo, $subject, $header . $message . $footer, $txtFrom);

?>

Nightfire
06-30-2005, 02:09 AM
What doesn't work on it? Doesn't send? Sends blank email? Get an error?

andrew1234
06-30-2005, 07:33 AM
hi

I get this error:


Notice: Undefined variable: message in /home/test.com/ftp/html/sent.php on line 11


thanks for the help

Nightfire
06-30-2005, 02:23 PM
Change this


$message .= "Name : $name \n\n";
$message .= "E-mail : $email \n\n";
$message .= "Telephone : $code $tel \n\n";
$message .= "Question : $textarea \n\n";

to


$message = "Name : $name \n\n";
$message .= "E-mail : $email \n\n";
$message .= "Telephone : $code $tel \n\n";
$message .= "Question : $textarea \n\n";

JamieR
06-30-2005, 02:44 PM
Nightfire, sorry to sound like a complete idiot here, but why is a dot being used after the variable name? like $message .=?

:o

Brandoe85
06-30-2005, 02:52 PM
The '.' is the concatenation operator, it's just like '+=' in other languages. So it takes whats allready in the variable and tacs more onto the end.

JamieR
06-30-2005, 02:53 PM
ah right, thanks - I gotta learn more php :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum