I have a mail script on my server to submit links, but I keep getting the error:
Parse error: syntax error, unexpected '[', expecting ')' in /home/tails5t/public_html/submit.php on line 32
The source code is here:
[php]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Send Mail</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.****">
<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">
<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\"><meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">
<!--mstheme--><link rel="stylesheet" type="text/css" href="_themes/zero/zero1111.css"><meta name="Microsoft Theme" content="zero 1111, default">
<meta name="Microsoft Border" content="none, default">
</head>
<body>
<p align="center"><!--webbot bot="Navigation" S-Type="banner"
S-Rendering="graphics" S-Orientation B-Include-Home B-Include-Up U-Page S-Target startspan
--><img src="_derived/send_mail.htm_cmp_zero110_bnr.gif" width="580" height="60" border="0" alt="Submit Link"><!--webbot bot="Navigation" endspan i-checksum="48039"
-->
</p>
<p align="center">Sending mail, please wait...</p>
<p align=center style='text-align:center'>Sending mail, please wait...<o:p></o:p></p>
<p align=center style='text-align:center'>
<?php
$EmailTo = "tails5is@hotmail.com";
$Subject = "Link submission";
$Name = Trim(stripslashes($_POST['Name']));
$email = Trim(stripslashes($_POST['email']));
$Website = Trim(stripslashes($_POST['Website']));
$text = Trim(stripslashes(['Comments']));
$validationOK=true;
if (!$validationOK) {
print "";
exit;
}
$Body = "" ;
$Body .= Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "e-mail:"
$Body .= $Address;
$Body .= "\n";
$Body .= "Phone: ";
$Body .= $Phone;
$Body .= "\n";
$Body .= "Website: ";
$Body .= $Website;
$Body .= "\n";
$Body .= "\n";
$Body .= "Description: ";
$Body .= $text;
$Body .= "\n"
$success = mail($EmailTo, $Subject, $Body,"From: <$email>");
if ($success){
print ""<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print ""<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
</body>
</html>
[/php]
Help with mail script
Help with mail script
Webmaster Yoda: You must confront the cPanel. Then, and only then, a webmaster will you be.
Julius Caesar: Veni, vidi, posti
Sorry!
Sorry for double posting! You can delete this, but please fix my
Code: Select all
tag on my thread, sorry.
Webmaster Yoda: You must confront the cPanel. Then, and only then, a webmaster will you be.
Julius Caesar: Veni, vidi, posti
-
- Posts: 348
- Joined: Thu Jan 12, 2006 8:24 pm
- Contact:
Okay, that error's fixed, but I've got a new one that I don't understand, because $email is defined. Now I'm getting:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Send Mail</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.****">
<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">
<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\"><meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">
<!--mstheme--><link rel="stylesheet" type="text/css" href="_themes/zero/zero1111.css"><meta name="Microsoft Theme" content="zero 1111, default">
<meta name="Microsoft Border" content="none, default">
</head>
<body>
<p align="center"><!--webbot bot="Navigation" S-Type="banner"
S-Rendering="graphics" S-Orientation B-Include-Home B-Include-Up U-Page S-Target startspan
--><img src="_derived/send_mail.htm_cmp_zero110_bnr.gif" width="580" height="60" border="0" alt="Submit Link"><!--webbot bot="Navigation" endspan i-checksum="48039"
-->
</p>
<p align="center">Sending mail, please wait...</p>
<p align=center style='text-align:center'>Sending mail, please wait...<o:p></o:p></p>
<p align=center style='text-align:center'><?php
$EmailTo = "tails5is@hotmail.com";
$Subject = "Link submission";
$Name = Trim(stripslashes($_POST['Name']));
$email = Trim(stripslashes($_POST['email']));
$Website = Trim(stripslashes($_POST['Website']));
$text = Trim(stripslashes($_POST['describe']));
$validationOK=true;
if (!$validationOK) {
print "";
exit;
}
$Body = "" ;
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "\n";
$Body .= "e-mail: "
$Body .= $email;
$Body .= "\n";
$Body .= "\n";
$Body .= "Website: ";
$Body .= $Website;
$Body .= "\n";
$Body .= "\n";
$Body .= "Description: ";
$Body .= "\n";
$Body .= $text;
$Body .= "\n"
$success = mail($EmailTo, $Subject, $Body,"From: <$email>");
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print ""<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
</body>
</html>
[/php]
Here is the code:[php]Parse error: syntax error, unexpected T_VARIABLE in /home/tails5t/public_html/submit.php on line 45
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Send Mail</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.****">
<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">
<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\"><meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">
<!--mstheme--><link rel="stylesheet" type="text/css" href="_themes/zero/zero1111.css"><meta name="Microsoft Theme" content="zero 1111, default">
<meta name="Microsoft Border" content="none, default">
</head>
<body>
<p align="center"><!--webbot bot="Navigation" S-Type="banner"
S-Rendering="graphics" S-Orientation B-Include-Home B-Include-Up U-Page S-Target startspan
--><img src="_derived/send_mail.htm_cmp_zero110_bnr.gif" width="580" height="60" border="0" alt="Submit Link"><!--webbot bot="Navigation" endspan i-checksum="48039"
-->
</p>
<p align="center">Sending mail, please wait...</p>
<p align=center style='text-align:center'>Sending mail, please wait...<o:p></o:p></p>
<p align=center style='text-align:center'><?php
$EmailTo = "tails5is@hotmail.com";
$Subject = "Link submission";
$Name = Trim(stripslashes($_POST['Name']));
$email = Trim(stripslashes($_POST['email']));
$Website = Trim(stripslashes($_POST['Website']));
$text = Trim(stripslashes($_POST['describe']));
$validationOK=true;
if (!$validationOK) {
print "";
exit;
}
$Body = "" ;
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "\n";
$Body .= "e-mail: "
$Body .= $email;
$Body .= "\n";
$Body .= "\n";
$Body .= "Website: ";
$Body .= $Website;
$Body .= "\n";
$Body .= "\n";
$Body .= "Description: ";
$Body .= "\n";
$Body .= $text;
$Body .= "\n"
$success = mail($EmailTo, $Subject, $Body,"From: <$email>");
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print ""<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
</body>
</html>
[/php]
Webmaster Yoda: You must confront the cPanel. Then, and only then, a webmaster will you be.
Julius Caesar: Veni, vidi, posti
you forgot ; in few places. Now script is without any php errors
[PHP]<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Send Mail</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.****">
<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">
<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\"><meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">
<!--mstheme--><link rel="stylesheet" type="text/css" href="_themes/zero/zero1111.css"><meta name="Microsoft Theme" content="zero 1111, default">
<meta name="Microsoft Border" content="none, default">
</head>
<body>
<p align="center"><!--webbot bot="Navigation" S-Type="banner"
S-Rendering="graphics" S-Orientation B-Include-Home B-Include-Up U-Page S-Target startspan
--><img src="_derived/send_mail.htm_cmp_zero110_bnr.gif" width="580" height="60" border="0" alt="Submit Link"><!--webbot bot="Navigation" endspan i-checksum="48039"
-->
</p>
<p align="center">Sending mail, please wait...</p>
<p align=center style='text-align:center'>Sending mail, please wait...<o:p></o:p></p>
<p align=center style='text-align:center'><?php
$EmailTo = "tails5is@hotmail.com";
$Subject = "Link submission";
$Name = Trim(stripslashes($_POST['Name']));
$email = Trim(stripslashes($_POST['email']));
$Website = Trim(stripslashes($_POST['Website']));
$text = Trim(stripslashes($_POST['describe']));
$validationOK=true;
if (!$validationOK) {
print "";
exit;
}
$Body = "" ;
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "\n";
$Body .= "e-mail: ";
$Body .= $email;
$Body .= "\n";
$Body .= "\n";
$Body .= "Website: ";
$Body .= $Website;
$Body .= "\n";
$Body .= "\n";
$Body .= "Description: ";
$Body .= "\n";
$Body .= $text;
$Body .= "\n";
$success = mail($EmailTo, $Subject, $Body,"From: <$email>");
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
</body>
</html>[/PHP]
[PHP]<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Send Mail</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.****">
<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">
<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\"><meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">
<!--mstheme--><link rel="stylesheet" type="text/css" href="_themes/zero/zero1111.css"><meta name="Microsoft Theme" content="zero 1111, default">
<meta name="Microsoft Border" content="none, default">
</head>
<body>
<p align="center"><!--webbot bot="Navigation" S-Type="banner"
S-Rendering="graphics" S-Orientation B-Include-Home B-Include-Up U-Page S-Target startspan
--><img src="_derived/send_mail.htm_cmp_zero110_bnr.gif" width="580" height="60" border="0" alt="Submit Link"><!--webbot bot="Navigation" endspan i-checksum="48039"
-->
</p>
<p align="center">Sending mail, please wait...</p>
<p align=center style='text-align:center'>Sending mail, please wait...<o:p></o:p></p>
<p align=center style='text-align:center'><?php
$EmailTo = "tails5is@hotmail.com";
$Subject = "Link submission";
$Name = Trim(stripslashes($_POST['Name']));
$email = Trim(stripslashes($_POST['email']));
$Website = Trim(stripslashes($_POST['Website']));
$text = Trim(stripslashes($_POST['describe']));
$validationOK=true;
if (!$validationOK) {
print "";
exit;
}
$Body = "" ;
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "\n";
$Body .= "e-mail: ";
$Body .= $email;
$Body .= "\n";
$Body .= "\n";
$Body .= "Website: ";
$Body .= $Website;
$Body .= "\n";
$Body .= "\n";
$Body .= "Description: ";
$Body .= "\n";
$Body .= $text;
$Body .= "\n";
$success = mail($EmailTo, $Subject, $Body,"From: <$email>");
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
</body>
</html>[/PHP]