comicw
12-28-2002, 01:24 PM
Hi,
I've been editing a template for my mailing list, it's in PHTML, but I keep getting this error. Does anyone of you know what the problem is?
Are there any other problems that I may have overlooked?
Thanks!
Here's the error:
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/broken/public_html/mlm/subscribe.phtml on line 49
Here's the phtml code:
<head>
<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\"><link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.womenpol.be/site/nederlands/default.css\">
<style type=text/css>
Body {scrollbar-3dlight-color : #AAAAB9; scrollbar-arrow-color : #FFB336; scrollbar-base-color : #AAAAB9;
scrollbar-darkshadow-color : #AAAAB9; scrollbar-face-color : #304459; scrollbar-highlight-color : #AAAAB9;
scrollbar-shadow-color : #52525F; scrollbar-track-color : #AAAB9; font-size: 8.5pt; font-family: "Verdana"; color: #FFFFFF}
input.btn {color: #FFB336; background-color: #304459; font-size: 8.5pt; font-family: "Verdana"; font-weight: 600}
</style>
</head>
<body bgcolor="#304459">
<?
if (file_exists("setup/setup.phtml")):
include("setup/setup.phtml");
if (file_exists("$listadmin/$list.phtml")):
include("$listadmin/$list.phtml");
if (file_exists("$header.phtml")):
include("$header.phtml");
endif;
echo "<center><br><br><br>";
function emailOK($str) {
$badChars = "[ ]+| |\+|=|[|]|{|}|`|\(|\)|,|;|:|!|<|>|%|\*|/|'|\"|~|\?|#|\\$|\\&|\\^|www[.]";
return (eregi($badChars,$str));
}
if ($enc != ""):
if (file_exists("confirm/$enc")): $optin = "off"; include("confirm/$enc"); endif;
endif;
if ( !(eregi("([a-z0-9_\.-])+@([a-z0-9_\.-])+\.([a-z0-9_\.-])+",$email)) || emailOK($email)):
echo "<P>The address <b>$email</b> you submitted is wrong.
<BR>Please check and try again.";
echo "<P><FORM><INPUT class="btn" TYPE=BUTTON VALUE=\" Back \" onClick=\"history.go(-1)\"></form>";
else:
if (file_exists("$lists/$id.phtml")):
exec("grep $email $lists/$id.phtml",$execAr);
if ($execAr[0] != ""):
echo "<IMG SRC=\"http://www.brokenfrontier.com/images/fillinlogo1.png\" WIDTH=236 HEIGHT=110 BORDER=0><p><b>Error!</b><BR>This address has already been submitted to the list. <P><FORM><INPUT class="btn" TYPE=BUTTON VALUE=\" Back \" onClick=\"history.go(-1)\"></form>";
else:
if ($optin == "on"):
$enc = uniqid("");
$to = "$email";
$from = "$listname <$from>";
$subject = "Sign up Confirmation";
$body = "Thanks for subscribing to $listname list.\n\nTo confirm your registration, please click on the link below :\n$url/subscribe.phtml?list=$list&enc=$enc\n\nIf you did not register, do not click on the link and you will not receive any further newsletters.";
mail($to,$subject,$body,"FROM: ".$from);
$filemessage = "<? \$email = \"$email\"; ?>";
$cartFile = fopen("confirm/$enc","w+");
fputs($cartFile,$filemessage);
fclose($cartFile);
echo "Thanks!<P>A message has been sent to <b>$email</b> to complete your registration.<BR>Please check your email and follow the instructions. <P><FORM><INPUT class="btn" TYPE=BUTTON VALUE=\" Back \" onClick=\"history.go(-1)\"></form>";
else:
$filename = "$lists/$id.phtml";
$fd = fopen( $filename, "r" );
$contents = fread( $fd, filesize( $filename ) );
fclose( $fd );
if ($contents == ""):
$fileMessage = "$email";
else:
$fileMessage = "\n$email";
endif;
$count=0;
$maxloop=5;
$finished=0;
while ($count<$maxloop&&!$finished) {
if (file_exists("$lists/$id.phtml")):
exec ("mv -f $lists/$id.phtml $lists/$id.tmp");
$cartFile = fopen("$lists/$id.tmp","a+");
fputs($cartFile,$fileMessage);
fclose($cartFile);
exec ("mv -f $lists/$id.tmp $lists/$id.phtml");
$finished=1;
else:
sleep(1);
endif;
$count++;
}
echo "<IMG SRC=\"http://www.brokenfrontier.com/images/fillinlogo1.png\" WIDTH=236 HEIGHT=110 BORDER=0><P>Thanks!<P><b>$email</b> has been added to the mailing list.";
endif;
endif;
else:
echo "<IMG SRC=\"http://www.brokenfrontier.com/images/fillinlogo1.png\" WIDTH=236 HEIGHT=110 BORDER=0><P><b>Error!</b><BR>The newsletter to which you want to subscribe no longer exists.";
endif;
endif;
else:
echo "Sorry, your address cannot be added at the moment.<BR>Please try again later.";
endif;
else:
echo "Sorry, your address cannot be added at the moment.<BR>Please try again later.";
endif;
if (file_exists("$footer.phtml")):
include("$footer.phtml");
endif;
?>
</body>
I've been editing a template for my mailing list, it's in PHTML, but I keep getting this error. Does anyone of you know what the problem is?
Are there any other problems that I may have overlooked?
Thanks!
Here's the error:
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/broken/public_html/mlm/subscribe.phtml on line 49
Here's the phtml code:
<head>
<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\"><link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.womenpol.be/site/nederlands/default.css\">
<style type=text/css>
Body {scrollbar-3dlight-color : #AAAAB9; scrollbar-arrow-color : #FFB336; scrollbar-base-color : #AAAAB9;
scrollbar-darkshadow-color : #AAAAB9; scrollbar-face-color : #304459; scrollbar-highlight-color : #AAAAB9;
scrollbar-shadow-color : #52525F; scrollbar-track-color : #AAAB9; font-size: 8.5pt; font-family: "Verdana"; color: #FFFFFF}
input.btn {color: #FFB336; background-color: #304459; font-size: 8.5pt; font-family: "Verdana"; font-weight: 600}
</style>
</head>
<body bgcolor="#304459">
<?
if (file_exists("setup/setup.phtml")):
include("setup/setup.phtml");
if (file_exists("$listadmin/$list.phtml")):
include("$listadmin/$list.phtml");
if (file_exists("$header.phtml")):
include("$header.phtml");
endif;
echo "<center><br><br><br>";
function emailOK($str) {
$badChars = "[ ]+| |\+|=|[|]|{|}|`|\(|\)|,|;|:|!|<|>|%|\*|/|'|\"|~|\?|#|\\$|\\&|\\^|www[.]";
return (eregi($badChars,$str));
}
if ($enc != ""):
if (file_exists("confirm/$enc")): $optin = "off"; include("confirm/$enc"); endif;
endif;
if ( !(eregi("([a-z0-9_\.-])+@([a-z0-9_\.-])+\.([a-z0-9_\.-])+",$email)) || emailOK($email)):
echo "<P>The address <b>$email</b> you submitted is wrong.
<BR>Please check and try again.";
echo "<P><FORM><INPUT class="btn" TYPE=BUTTON VALUE=\" Back \" onClick=\"history.go(-1)\"></form>";
else:
if (file_exists("$lists/$id.phtml")):
exec("grep $email $lists/$id.phtml",$execAr);
if ($execAr[0] != ""):
echo "<IMG SRC=\"http://www.brokenfrontier.com/images/fillinlogo1.png\" WIDTH=236 HEIGHT=110 BORDER=0><p><b>Error!</b><BR>This address has already been submitted to the list. <P><FORM><INPUT class="btn" TYPE=BUTTON VALUE=\" Back \" onClick=\"history.go(-1)\"></form>";
else:
if ($optin == "on"):
$enc = uniqid("");
$to = "$email";
$from = "$listname <$from>";
$subject = "Sign up Confirmation";
$body = "Thanks for subscribing to $listname list.\n\nTo confirm your registration, please click on the link below :\n$url/subscribe.phtml?list=$list&enc=$enc\n\nIf you did not register, do not click on the link and you will not receive any further newsletters.";
mail($to,$subject,$body,"FROM: ".$from);
$filemessage = "<? \$email = \"$email\"; ?>";
$cartFile = fopen("confirm/$enc","w+");
fputs($cartFile,$filemessage);
fclose($cartFile);
echo "Thanks!<P>A message has been sent to <b>$email</b> to complete your registration.<BR>Please check your email and follow the instructions. <P><FORM><INPUT class="btn" TYPE=BUTTON VALUE=\" Back \" onClick=\"history.go(-1)\"></form>";
else:
$filename = "$lists/$id.phtml";
$fd = fopen( $filename, "r" );
$contents = fread( $fd, filesize( $filename ) );
fclose( $fd );
if ($contents == ""):
$fileMessage = "$email";
else:
$fileMessage = "\n$email";
endif;
$count=0;
$maxloop=5;
$finished=0;
while ($count<$maxloop&&!$finished) {
if (file_exists("$lists/$id.phtml")):
exec ("mv -f $lists/$id.phtml $lists/$id.tmp");
$cartFile = fopen("$lists/$id.tmp","a+");
fputs($cartFile,$fileMessage);
fclose($cartFile);
exec ("mv -f $lists/$id.tmp $lists/$id.phtml");
$finished=1;
else:
sleep(1);
endif;
$count++;
}
echo "<IMG SRC=\"http://www.brokenfrontier.com/images/fillinlogo1.png\" WIDTH=236 HEIGHT=110 BORDER=0><P>Thanks!<P><b>$email</b> has been added to the mailing list.";
endif;
endif;
else:
echo "<IMG SRC=\"http://www.brokenfrontier.com/images/fillinlogo1.png\" WIDTH=236 HEIGHT=110 BORDER=0><P><b>Error!</b><BR>The newsletter to which you want to subscribe no longer exists.";
endif;
endif;
else:
echo "Sorry, your address cannot be added at the moment.<BR>Please try again later.";
endif;
else:
echo "Sorry, your address cannot be added at the moment.<BR>Please try again later.";
endif;
if (file_exists("$footer.phtml")):
include("$footer.phtml");
endif;
?>
</body>