Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse error

Status
Not open for further replies.

jozino01

Technical User
Apr 25, 2003
257
CA
Hi,

I receive this error message:

"Parse error: parse error, unexpected T_VARIABLE in /mnt/host-users/m/a/d/mado/mail.php on line 28"

Here is the script:

<html>
<head>
<title>PHP Mailer</title>
</head>
<body>
<?php
$i=0;
if (!is_array($HTTP_POST_VARS))
return;
reset($HTTP_POST_VARS);
while(list($key, $val) = each($HTTP_POST_VARS)) {
$GLOBALS[$key] = $val;
$val=stripslashes($val);
echo "<b>$key</b> = $val<br>";
$message = $message."$key = $val\n";
}

$message= "$message";


require("class.smtp.php");
$smtp=new smtp();
$smtp->host_name = "localhost";
$smtp->localhost = "host.sk";


$from = "md@stonline.sk";
$to = "jzn1@yahoo.com"
$subject = "Your message";
$text = "$message";

$smtp->SendMessage( $from, array( $to ), array( "From: $from", "To: $to", "Subject: $subject" ), $text );
echo "<p>OK</p>";
?>
</body>
</html>

Any idea what is wrong, please?
 
I think your error is here:
Code:
$to = "jzn1@yahoo.com"

It looks like you need a ";" at the end.

Hope that helps.
 
if i am right, the line 28 is:

$subject = "Your message";
 
The PHP interpreter "cjokes" on an error and outputs the line number ot got to. In many cases, such as in yours the offending piece of code is before that.
Your ommission of the semicolon creates an error in the next line. So, in the future, look also at the lines before the one that PHP spits out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top