| | |
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2008
Posts: 12
Reputation:
Solved Threads: 0
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.
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)
http://rapidshare.com/files/90603607/yourownbux_base.zip.html
•
•
Join Date: Feb 2008
Posts: 12
Reputation:
Solved Threads: 0
And one more question how can i change white background in the site... please see the script and tell me i need it ASAP.
•
•
Join Date: Oct 2007
Posts: 18
Reputation:
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.
or
of course there are problems here as well. for example
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.
since in Php you can use one inside the other with few problems you can do this.
PHP Syntax (Toggle Plain Text)
echo 'look at all "these" double quotes that "are not escaped" because the string closes here';
or
PHP Syntax (Toggle Plain Text)
echo "single 'quotes ' can go inside double quotes";
of course there are problems here as well. for example
PHP Syntax (Toggle Plain Text)
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.
•
•
Join Date: Feb 2008
Posts: 12
Reputation:
Solved Threads: 0
<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>
";
}
?>
<?
// 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>
";
}
?>
•
•
Join Date: Feb 2008
Posts: 12
Reputation:
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.
•
•
•
•
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
•
•
•
•
<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>
";
}
?>
![]() |
Similar Threads
- syntax error, unexpected $end in ndex.php on line 127 (PHP)
- help a newbie? mySQL find & replace (MySQL)
- Warning: Unexpected character in input: (PHP)
- I want to let members message each other (PHP)
Other Threads in the PHP Forum
- Previous Thread: Pagination
- Next Thread: convert microsoft word to html
| Thread Tools | Search this Thread |
ajax apache api array arrays beginner binary broken cache cakephp checkbox class cms code confirm cron curl customizableitems database date display dynamic echo email error external file files folder form forms forum function functions google header headmethod howtowriteathesis href htaccess html iframe image include insert integration ip java javascript joomla limit link login loop mail malfunction menu mlm multiple mysql neutrality oop paypal pdf php phpmysql play problem query question radio random recursion regex remote root script search select server sessions sms soap source space sql support! syntax system table tutorial update upload url validator variable video web xml youtube





