Jump to content


Photo

Parse error... parse error... not another parse error


  • Please log in to reply
3 replies to this topic

#1 vombomin

vombomin
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 06 April 2006 - 10:20 AM

Hi guys I was wondering if you could help me... I am getting parse errors o¡in a script I am witting

the error is

Parse error: parse error, unexpected T_IF in /home/helpreal/public_html/test5/manager/index.php on line 8

heres the code ifit makes it any easier to help

<?php

include( "../database.php" );

$settings_result = mysql_query("SELECT access_id,status FROM settings where id = '1'", $db);
$setif($setting->access_id == "0" or $setting->status != MD5("1"))

if ($sting = mysql_fetch_object("$settings_results")) {
//setting->access_id == "0"){
header("location: mgr.php");
exit;
} else {
// REDIRECT TO LOGIN PAGEss
header("location: login.php");
// IF REDIRECT FAILS PRINT LINK TO LOGIN PAGE
echo "<a href=\"login.php\"><font face=\"arial\" size=\"2\" color=\"#0065FC\">Click here to log into your site manager.</font></a>";
exit;
}
?>

hope this is helpful

#2 Honoré

Honoré
  • Members
  • PipPipPip
  • Advanced Member
  • 66 posts
  • LocationAntwerp - Belgium

Posted 06 April 2006 - 10:56 AM

Put a ; after the following statement:
$setif($setting->access_id == "0" or $setting->status != MD5("1"));

Or was this intended as an if statement?

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 06 April 2006 - 02:13 PM

If you get a parse error in this format:
Parse error: parse error, unexpected T_[x] in [path/of/script/here.php] on line [line numer here]

Always check that you are ending your PHP lines with a semi-colon (;). Usually the line number gives it away. Do not look at the line PHP says the error is on as that is not where you missing the semi-colon, as the proper error is usually 1 or 2 lines above where the error occured. So if you get a parse error that says an unexpected T_VARIABLE on line 12 then look at lines 9 - 11 to make sure you are ending your lines correctly.

#4 Eugene

Eugene
  • Members
  • PipPipPip
  • Advanced Member
  • 126 posts

Posted 06 April 2006 - 02:33 PM

$setif($setting->access_id == "0" or $setting->status != MD5("1"))

You forgot the semicolin here. (;)

$setif($setting->access_id == "0" or $setting->status != MD5("1"));





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users