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

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.

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.

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

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

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.

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

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

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

";
}

?>

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

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

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

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

";
}

?>

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.