Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

Reply

Join Date: Feb 2008
Posts: 12
Reputation: xceed has a little shameless behaviour in the past 
Solved Threads: 0
xceed xceed is offline Offline
Newbie Poster

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

 
0
  #1
Feb 10th, 2008
Hi guys look at this.

http://1.fabriconengineers.com/index.php

Look at the menu

http://img517.imageshack.us/img517/8...forenv8.th.jpg

http://img248.imageshack.us/img248/460/afterur5.th.jpg

after i add image in the menu it says
= Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/fabricon/public_html/1/menu.php on line 97

How can i solve this???

Please help.

Script Download Link.
  1. http://rapidshare.com/files/90603607/yourownbux_base.zip.html
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 12
Reputation: xceed has a little shameless behaviour in the past 
Solved Threads: 0
xceed xceed is offline Offline
Newbie Poster

Re: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

 
0
  #2
Feb 10th, 2008
And one more question how can i change white background in the site... please see the script and tell me i need it ASAP.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 18
Reputation: jonesc5 is an unknown quantity at this point 
Solved Threads: 0
jonesc5 jonesc5 is offline Offline
Newbie Poster

Re: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

 
0
  #3
Feb 10th, 2008
To get that error you usually have to miss a ' or a ".

since in Php you can use one inside the other with few problems you can do this.

  1.  
  2. echo 'look at all "these" double quotes that "are not escaped" because the string closes here';

or

  1. echo "single 'quotes ' can go inside double quotes";

of course there are problems here as well. for example

  1. echo 'he said "this won't work" but why not';
  2.  

will error becasue of the word won't.


You probably have some non escaped double quotes in your link. Try changing the echo to use singles quotes for the over all wrap round. Looks like the image link is produced by someone else so thats the most likely.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 12
Reputation: xceed has a little shameless behaviour in the past 
Solved Threads: 0
xceed xceed is offline Offline
Newbie Poster

Re: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

 
0
  #4
Feb 11th, 2008
Sorry mate but i am dummy in this php... can you please change the script and PM me please...

And BTW This is not my script i brought it from somewhere else. anyways thanks for the heads up.
Last edited by xceed; Feb 11th, 2008 at 2:03 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 205
Reputation: carobee is an unknown quantity at this point 
Solved Threads: 11
carobee carobee is offline Offline
Posting Whiz in Training

Re: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

 
0
  #5
Feb 11th, 2008
can you please post the code. i guess the site is blocked, so i am not able to view the code
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 18
Reputation: jonesc5 is an unknown quantity at this point 
Solved Threads: 0
jonesc5 jonesc5 is offline Offline
Newbie Poster

Re: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

 
0
  #6
Feb 11th, 2008
change the " on line 92 and line 102 into a ' then see what happens
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 12
Reputation: xceed has a little shameless behaviour in the past 
Solved Threads: 0
xceed xceed is offline Offline
Newbie Poster

Re: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

 
0
  #7
Feb 11th, 2008
Originally Posted by jonesc5 View Post
change the " on line 92 and line 102 into a ' then see what happens
ok ill try. thanks for you and others for help. wait ill post the code.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 12
Reputation: xceed has a little shameless behaviour in the past 
Solved Threads: 0
xceed xceed is offline Offline
Newbie Poster

Re: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

 
0
  #8
Feb 11th, 2008
<table width="900" cellpadding="0" cellspacing="0" style="margin-top:3px;"><tr><td style="border-bottom:1px #666 solid;padding:2px;" bgcolor="#eeeeee">
<?


// Si estan definidas las variables de las cookies se procede a mostrar el menu pero no sin antes comprobar que los
// datos de las cookies verdaderamete son del usuario en cuestion.

if(isset($_COOKIE["usNick"]) && isset($_COOKIE["usPass"]))
{

// Se incluyen los archivos necesarios

require('config.php');
require('funciones.php');

// Se sanitizan los datos de las cokies

$user=uc($_COOKIE["usNick"]);

// Se selecciona la tabla tb_users donde el usuario es el que se provee en la cookie

$sql = "SELECT * FROM tb_users WHERE username='$user'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);

// Se sanitiza de nuevo la cookie

$wask = uc($_COOKIE["usNick"]);

// Se define $wesk como el nombre de usuario de la tabla tb_users

$wesk = $row['username'];

// Se comprueba que el dato de la cookie sea el mismo que el de la tabla, de lo contrario se muestra error, se termina
// el script y se borra la cookie.

if("$wesk" != "$wask") {
echo "Login incorrecto.";
?>
<input type="button" value="Reload Page" onClick="window.location.reload()">
<?
exit();
}

// Se sanitiza la cookie usPass

$wazk = uc($_COOKIE["usPass"]);

// Se define $wezk como el nombre de usuario de la tabla tb_users

$wezk = $row['password'];

// Se comprueba que el dato de la cookie sea el mismo que el de la tabla, de lo contrario se muestra error, se termina
// el script y se borra la cookie.

if("$wezk" != "$wazk") {
echo "Login incorrecto.";
?>
<input type="button" value="Reload Page" onClick="window.location.reload()">
<?
exit();
}

echo"

<center>
<font size=\"2\" face=\"verdana\">
<b>
[ Logged in as <font color=\"#000066\">".$row['username']."</font> ] - <a href=\"surf.php\">Surf Ads</a> - <a href=\"members.php\">Members</a> - <a href=\"logout.php\">Logout</a> - <a href=\"faq.php\">FAQ</a> - <a href=\"advertise.php\">Advertise</a> - <a href=\"contact.php\">Contact</a>
</b>
</font>
</center>

";

}
else
{

// funcion para sanitizar variables
function limpiare($mensaje)
{
$mensaje = htmlentities(stripslashes(trim($mensaje)));
$mensaje = str_replace("'"," ",$mensaje);
$mensaje = str_replace(";"," ",$mensaje);
$mensaje = str_replace("$"," ",$mensaje);
return $mensaje;
}

$elref=limpiare($_GET["r"]);

echo "

<center>
<font size=\"2\" face=\"verdana\">
<b>
<a href=\"surf.php\"><img src="http://img408.imageshack.us/img408/8927/20061951img7jj1.gif" border="0" alt="Image Hosted by ImageShack.us"/></a> - <a href=\"register.php?r=".$elref."\">Register</a> - <a href=\"login.php\">Login</a> - <a href=\"faq.php\">FAQ</a> - <a href=\"advertise.php\">Advertise</a> - <a href=\"contact.php\">Contact</a>
</b>
</font>
</center>

";
}











?>
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 18
Reputation: jonesc5 is an unknown quantity at this point 
Solved Threads: 0
jonesc5 jonesc5 is offline Offline
Newbie Poster

Re: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

 
0
  #9
Feb 11th, 2008
yeah use single quotes for the last echo. Or put escape slashes in front of the "s in the link.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 12
Reputation: xceed has a little shameless behaviour in the past 
Solved Threads: 0
xceed xceed is offline Offline
Newbie Poster

Re: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

 
0
  #10
Feb 11th, 2008
Originally Posted by jonesc5 View Post
change the " on line 92 and line 102 into a ' then see what happens
Originally Posted by jonesc5 View Post
yeah use single quotes for the last echo. Or put escape slashes in front of the "s in the link.
I get this error

Warning: main(menu.php) [function.main]: failed to open stream: No such file or directory in /home/fabricon/public_html/1/index.php on line 60

Warning: main(menu.php) [function.main]: failed to open stream: No such file or directory in /home/fabricon/public_html/1/index.php on line 60

Warning: main(menu.php) [function.main]: failed to open stream: No such file or directory in /home/fabricon/public_html/1/index.php on line 60

Warning: main() [function.include]: Failed opening 'menu.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/fabricon/public_html/1/index.php on line 60
when i do this editing
<table width="900" cellpadding="0" cellspacing="0" style="margin-top:3px;"><tr><td style="border-bottom:1px #666 solid;padding:2px;" bgcolor="#eeeeee">
<?


// Si estan definidas las variables de las cookies se procede a mostrar el menu pero no sin antes comprobar que los
// datos de las cookies verdaderamete son del usuario en cuestion.

if(isset($_COOKIE["usNick"]) && isset($_COOKIE["usPass"]))
{

// Se incluyen los archivos necesarios

require('config.php');
require('funciones.php');

// Se sanitizan los datos de las cokies

$user=uc($_COOKIE["usNick"]);

// Se selecciona la tabla tb_users donde el usuario es el que se provee en la cookie

$sql = "SELECT * FROM tb_users WHERE username='$user'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);

// Se sanitiza de nuevo la cookie

$wask = uc($_COOKIE["usNick"]);

// Se define $wesk como el nombre de usuario de la tabla tb_users

$wesk = $row['username'];

// Se comprueba que el dato de la cookie sea el mismo que el de la tabla, de lo contrario se muestra error, se termina
// el script y se borra la cookie.

if("$wesk" != "$wask") {
echo "Login incorrecto.";
?>
<input type="button" value="Reload Page" onClick="window.location.reload()">
<?
exit();
}

// Se sanitiza la cookie usPass

$wazk = uc($_COOKIE["usPass"]);

// Se define $wezk como el nombre de usuario de la tabla tb_users

$wezk = $row['password'];

// Se comprueba que el dato de la cookie sea el mismo que el de la tabla, de lo contrario se muestra error, se termina
// el script y se borra la cookie.

if("$wezk" != "$wazk") {
echo "Login incorrecto.";
?>
<input type="button" value="Reload Page" onClick="window.location.reload()">
<?
exit();
}

echo"

<center>
<font size=\"2\" face=\"verdana\">
<b>
[ Logged in as <font color=\"#000066\">".$row['username']."</font> ] - <a href=\"surf.php\">Surf Ads</a> - <a href=\"members.php\">Members</a> - <a href=\"logout.php\">Logout</a> - <a href=\"faq.php\">FAQ</a> - <a href=\"advertise.php\">Advertise</a> - <a href=\"contact.php\">Contact</a>
</b>
</font>
</center>

";

}
else
{

// funcion para sanitizar variables
function limpiare($mensaje)
{
$mensaje = htmlentities(stripslashes(trim($mensaje)));
$mensaje = str_replace("'"," ",$mensaje);
$mensaje = str_replace(";"," ",$mensaje);
$mensaje = str_replace("$"," ",$mensaje);
return $mensaje;
}

$elref=limpiare($_GET["r"]);

echo '

<center>
<font size=\"2\" face=\"verdana\">
<b>
<a href=\'surf.php\"><img src="http://img408.imageshack.us/img408/8927/20061951img7jj1.gif" border="0" alt="Image Hosted by ImageShack.us"/></a> - <a href=\"register.php?r=".$elref."\">Register</a> - <a href=\"login.php\">Login</a> - <a href=\"faq.php\">FAQ</a> - <a href=\"advertise.php\">Advertise</a> - <a href=\"contact.php\">Contact</a>
</b>
</font>
</center>

";
}











?>
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC