Question by : Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’ in D:\Hosting09817\html\members.php on?
I’m getting a Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’ in D:\Hosting09817\html\members.php on line 24. This is the file:
// Connects to your Database
mysql_connect("host",
"user", "password") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());
//checks cookies to make sure they are logged in
if(isset($ _COOKIE['ID_my_site']))
{
$ username = $ _COOKIE['ID_my_site'];
$ pass = $ _COOKIE['Key_my_site'];
$ check = mysql_query("SELECT * FROM users WHERE username =
'$ username'")or die(mysql_error());
while($ info = mysql_fetch_array( $ check ))
{
//if the cookie has the wrong password, they are taken to the
login page
if ($ pass != $ info['password'])
{ header("Location: login.php");
}
//otherwise they are shown the admin area
else
{
echo "
Secret Soccer Page
“;
echo “
“;
echo “
Welcome to the Secret Soccer Page! This page will
give you up to date (hopefully) live streams from teams such
as Besiktas JK (Turkey), Chicago Fire (USA), and other popular
ones such as Barcelona and others.”;
echo “
Go to home page”;
echo “Logout’;
}
}
}
else
//if the cookie does not exist, they are taken to the login
screen
{
header(“Location: login.php”);
}
?>
now i got Parse error: syntax error, unexpected T_ECHO, expecting ‘,’ or ‘;’ in D:\Hosting09817\html\members.php on line 25
i deleted the post that someone told me wasn’t php
Best answer:
Answer by roybob00
You have an unterminated string constant. That’s why it’s asking for “;” When you use echo, you start the string with a quotation mark. You ended it with your first instance of the quotation mark, just after method=. You will need to escape all quotation marks \” in order for the parser to recognize it as a valid PHP string.
Know better? Leave your own answer in the comments!