954,167 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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

Hi guys look at this.

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

Look at the menu

[img]http://img517.imageshack.us/img517/8615/beforenv8.th.jpg[/img]

[img]http://img248.imageshack.us/img248/460/afterur5.th.jpg[/img]

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.

http://rapidshare.com/files/90603607/yourownbux_base.zip.html
xceed
Newbie Poster
12 posts since Feb 2008
Reputation Points: 5
Solved Threads: 0
 
http://1.fabriconengineers.com/index.php

And one more question how can i change white background in the site... please see the script and tell me i need it ASAP.

xceed
Newbie Poster
12 posts since Feb 2008
Reputation Points: 5
Solved Threads: 0
 

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.

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


or

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


of course there are problems here as well. for example

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


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.

jonesc5
Newbie Poster
18 posts since Oct 2007
Reputation Points: 8
Solved Threads: 0
 

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.

xceed
Newbie Poster
12 posts since Feb 2008
Reputation Points: 5
Solved Threads: 0
 

can you please post the code. i guess the site is blocked, so i am not able to view the code

carobee
Posting Whiz in Training
209 posts since Dec 2007
Reputation Points: 10
Solved Threads: 12
 

change the " on line 92 and line 102 into a ' then see what happens

jonesc5
Newbie Poster
18 posts since Oct 2007
Reputation Points: 8
Solved Threads: 0
 
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.

xceed
Newbie Poster
12 posts since Feb 2008
Reputation Points: 5
Solved Threads: 0
 


<?


// 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.";
?>

<?
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.";
?>

<?
exit();
}

echo"




[ Logged in as ".$row['username']." ] - Surf Ads - Members - Logout - FAQ - Advertise - Contact


";

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




- Register - Login - FAQ - Advertise - Contact


";
}

?>

xceed
Newbie Poster
12 posts since Feb 2008
Reputation Points: 5
Solved Threads: 0
 

yeah use single quotes for the last echo. Or put escape slashes in front of the "s in the link.

jonesc5
Newbie Poster
18 posts since Oct 2007
Reputation Points: 8
Solved Threads: 0
 
change the " on line 92 and line 102 into a ' then see what happens
yeah use single quotes for the last echo. Or put escape slashes in front of the "s in the link.

I get this errorWarning: 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
<?


// 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.";
?>

<?
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.";
?>

<?
exit();
}

echo"




[ Logged in as ".$row['username']." ] - Surf Ads - Members - Logout - FAQ - Advertise - Contact


";

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




- Register - Login - FAQ - Advertise - Contact


";
}

?>

xceed
Newbie Poster
12 posts since Feb 2008
Reputation Points: 5
Solved Threads: 0
 

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

It's all information there.. Just check & see on what level is this menu.php IT HAS TO BE in same dir as the php-file containing the function main(); Also you should provide menu.php as a string main("menu.php") after that look in fopen()... ... or if this is not the problem post this function here to see what is the reason.

fenixZ
Light Poster
25 posts since Feb 2008
Reputation Points: 10
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You