vombomin Posted April 6, 2006 Share Posted April 6, 2006 Hi guys I was wondering if you could help me... I am getting parse errors o¡in a script I am wittingthe error is Parse error: parse error, unexpected T_IF in /home/helpreal/public_html/test5/manager/index.php on line 8heres 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 Quote Link to comment Share on other sites More sharing options...
Honoré Posted April 6, 2006 Share Posted April 6, 2006 Put a ; after the following statement:$setif($setting->access_id == "0" or $setting->status != MD5("1"));Or was this intended as an if statement? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 6, 2006 Share Posted April 6, 2006 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. Quote Link to comment Share on other sites More sharing options...
Eugene Posted April 6, 2006 Share Posted April 6, 2006 [code]$setif($setting->access_id == "0" or $setting->status != MD5("1"))[/code]You forgot the semicolin here. (;)[code]$setif($setting->access_id == "0" or $setting->status != MD5("1"));[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.