942,790 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 22765
  • PHP RSS
You are currently viewing page 1 of this multi-page discussion thread
Feb 10th, 2008
0

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

Expand Post »
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.
PHP Syntax (Toggle Plain Text)
  1. http://rapidshare.com/files/90603607/yourownbux_base.zip.html
Similar Threads
Reputation Points: 5
Solved Threads: 0
Newbie Poster
xceed is offline Offline
12 posts
since Feb 2008
Feb 10th, 2008
0

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

And one more question how can i change white background in the site... please see the script and tell me i need it ASAP.
Reputation Points: 5
Solved Threads: 0
Newbie Poster
xceed is offline Offline
12 posts
since Feb 2008
Feb 10th, 2008
0

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

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.

PHP Syntax (Toggle Plain Text)
  1.  
  2. echo 'look at all "these" double quotes that "are not escaped" because the string closes here';

or

PHP Syntax (Toggle Plain Text)
  1. echo "single 'quotes ' can go inside double quotes";

of course there are problems here as well. for example

PHP Syntax (Toggle Plain Text)
  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.
Reputation Points: 8
Solved Threads: 0
Newbie Poster
jonesc5 is offline Offline
18 posts
since Oct 2007
Feb 11th, 2008
0

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

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.
Reputation Points: 5
Solved Threads: 0
Newbie Poster
xceed is offline Offline
12 posts
since Feb 2008
Feb 11th, 2008
0

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

can you please post the code. i guess the site is blocked, so i am not able to view the code
Reputation Points: 10
Solved Threads: 12
Posting Whiz in Training
carobee is offline Offline
209 posts
since Dec 2007
Feb 11th, 2008
0

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

change the " on line 92 and line 102 into a ' then see what happens
Reputation Points: 8
Solved Threads: 0
Newbie Poster
jonesc5 is offline Offline
18 posts
since Oct 2007
Feb 11th, 2008
0

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

Click to Expand / Collapse  Quote originally posted by jonesc5 ...
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.
Reputation Points: 5
Solved Threads: 0
Newbie Poster
xceed is offline Offline
12 posts
since Feb 2008
Feb 11th, 2008
0

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

<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>

";
}











?>
Reputation Points: 5
Solved Threads: 0
Newbie Poster
xceed is offline Offline
12 posts
since Feb 2008
Feb 11th, 2008
0

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

yeah use single quotes for the last echo. Or put escape slashes in front of the "s in the link.
Reputation Points: 8
Solved Threads: 0
Newbie Poster
jonesc5 is offline Offline
18 posts
since Oct 2007
Feb 11th, 2008
0

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

Click to Expand / Collapse  Quote originally posted by jonesc5 ...
change the " on line 92 and line 102 into a ' then see what happens
Click to Expand / Collapse  Quote originally posted by jonesc5 ...
yeah use single quotes for the last echo. Or put escape slashes in front of the "s in the link.
I get this error

Quote ...
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
Quote ...
<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>

";
}











?>
Reputation Points: 5
Solved Threads: 0
Newbie Poster
xceed is offline Offline
12 posts
since Feb 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Pagination
Next Thread in PHP Forum Timeline: Convert MS Word to HTML via File Upload





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC