RaythMistwalker Posted January 6, 2010 Share Posted January 6, 2010 <?php session_start(); require_once('../auth.php'); ini_set('display_errors', 'on'); error_reporting(E_ALL); $id=$_SESSION['SESS_MEMBER_ID']; include("../config.php"); mysql_connect(DB_HOST,DB_USER,DB_PASSWORD); @mysql_select_db(DB_DATABASE) or die( "Unable to select database"); $query="SELECT * FROM members WHERE member_id='$id'"; $result=mysql_query($query) or trigger_error('Query error! Query: <pre>'.$query.'</pre>Reason: ' . mysql_error()); $num=mysql_numrows($result); $username=mysql_result($result,0,"login"); //Get Real Session ID $getsessqry="SELECT sess_id FROM sessions WHERE username='$username'"; $sessqryres=mysql_query($getsessqry); $realSessID=mysql_result($sessqryres,0,"sess_id"); $currentSessionID=$_SESSION['SESSION_ID']; //Check is SESSION ID is Valid if ($realSessID != $currentSessionID) { header("location: ../logout.php"); } $src=$_GET['src']; //Update Session Info $baseUrl = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']; $sql = "UPDATE sessions SET last_click_at = now(), last_click_url = '$baseUrl', current_page = '$src' WHERE sess_id=$currentSessionID"; mysql_query($sql); mysql_close(); if ($src == 'home') { $src = admin.php'; } if ($src == 'newuser') { $src = 'new-user.php'; } if ($src == 'members') { $src = 'listmembers.php'; } if ($src == 'sysmessage') { $src = 'system-message.php'; } if ($src == 'arcadeplayers') { $src = 'arcadeadmin.php?action=players'; } if ($src == 'arcadegames') { $src = 'arcadeadmin.php?action=games'; } $i=0; while ($i < $num) { $first=mysql_result($result,$i,"firstname"); $last=mysql_result($result,$i,"lastname"); $rank=mysql_result($result,$i,"rank"); //Check whether the rank variable is present or not or is wrong if((trim($rank) != '9999')) { header("location: ../access-denied.php"); exit(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Member Index</title> <link href="../loginmodule.css" rel="stylesheet" type="text/css" /> </head> <body text="#0000ff" link="#00a5e9" vlink="#00a5e9" alink="#00a5e9" leftmargin="2" topmargin="2" marginwidth="2" marginheight="0"> <h1><font color=#000000>Welcome <?php echo $first;?> <?php echo $last;?></h1> Your Rank: <?php echo $rank; if ($rank==9999) { echo " (Admin)"; } if ($rank==999) { echo " (Performer)"; } if ($rank==99) { echo " (Groupie)"; } ?></font><br> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class='tableborder' height=100% text="#000000"> <tr> <td width=20% valign=top> <div class='maintitle'><center>Main Links</center></div><br> <a href="../member-index.php?src=home">Home</a><br> <a href="../member-index.php?src=profile">My Profile</a><Br> <a href="../member-index.php?src=members">Memberlist</a><Br> <a href="../member-index.php?src=messages">Message Inbox</a><br> <a href="../logout.php">Logout</a><br> <a href="../admin/index.php?src=home">Admin</a><br> <a href="../arcade/Arcade.php" target="blank">Arcade</a><br> <div class='maintitle'>Admin Links</div><br> <a href='index.php?src=home'>Admin Home</a><br> <a href='index.php?src=newuser'>Make New User</a><br> <a href='index.php?src=members'>List all Users</a><br> <a href='index.php?src=sysmessage'>System Message</a><br> <div class='maintitle'>Arcade Admin</div><br> <a href='index.php?src=arcadeplayers'>List Playerlist</a><br> <a href='index.php?src=arcadegames'>List Games</a><br> </td> <td width=80%> <table width=100% height=100%><tr> <iframe src="<? echo $src; ?>" width=100% height=500 name="adminWindow"></iframe> </td> </tr></table> <?php ++$i; } ?> </table> </body> </html> Right the deal is i can't install php on my computer (cause my comp is crap) and i don't have access to php.ini to edit stuff. I know there must be a parse error here and i can't find it. can anyone see it and if so you got a program which will check for parse errors? Quote Link to comment https://forums.phpfreaks.com/topic/187426-parse-errors/ Share on other sites More sharing options...
rajivgonsalves Posted January 6, 2010 Share Posted January 6, 2010 you got an error on line 35 this if ($src == 'home') { $src = admin.php'; } should be if ($src == 'home') { $src = 'admin.php'; } Quote Link to comment https://forums.phpfreaks.com/topic/187426-parse-errors/#findComment-989726 Share on other sites More sharing options...
co.ador Posted January 6, 2010 Share Posted January 6, 2010 not sure but try using single quotes for the header function instead of double quotes. Not sure try that That would be your fixed one below with rajivgonsalves fix... <?php session_start(); require_once('../auth.php'); ini_set('display_errors', 'on'); error_reporting(E_ALL); $id=$_SESSION['SESS_MEMBER_ID']; include("../config.php"); mysql_connect(DB_HOST,DB_USER,DB_PASSWORD); @mysql_select_db(DB_DATABASE) or die( "Unable to select database"); $query="SELECT * FROM members WHERE member_id='$id'"; $result=mysql_query($query) or trigger_error('Query error! Query: <pre>'.$query.'</pre>Reason: ' . mysql_error()); $num=mysql_numrows($result); $username=mysql_result($result,0,"login"); //Get Real Session ID $getsessqry="SELECT sess_id FROM sessions WHERE username='$username'"; $sessqryres=mysql_query($getsessqry); $realSessID=mysql_result($sessqryres,0,"sess_id"); $currentSessionID=$_SESSION['SESSION_ID']; //Check is SESSION ID is Valid if ($realSessID != $currentSessionID) { header("location: ../logout.php"); } $src=$_GET['src']; //Update Session Info $baseUrl = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']; $sql = "UPDATE sessions SET last_click_at = now(), last_click_url = '$baseUrl', current_page = '$src' WHERE sess_id=$currentSessionID"; mysql_query($sql); mysql_close(); if ($src == 'home') { $src = 'admin.php'; } if ($src == 'newuser') { $src = 'new-user.php'; } if ($src == 'members') { $src = 'listmembers.php'; } if ($src == 'sysmessage') { $src = 'system-message.php'; } if ($src == 'arcadeplayers') { $src = 'arcadeadmin.php?action=players'; } if ($src == 'arcadegames') { $src = 'arcadeadmin.php?action=games'; } $i=0; while ($i < $num) { $first=mysql_result($result,$i,"firstname"); $last=mysql_result($result,$i,"lastname"); $rank=mysql_result($result,$i,"rank"); //Check whether the rank variable is present or not or is wrong if((trim($rank) != '9999')) { header("location: ../access-denied.php"); exit(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Member Index</title> <link href="../loginmodule.css" rel="stylesheet" type="text/css" /> </head> <body text="#0000ff" link="#00a5e9" vlink="#00a5e9" alink="#00a5e9" leftmargin="2" topmargin="2" marginwidth="2" marginheight="0"> <h1><font color=#000000>Welcome <?php echo $first;?> <?php echo $last;?></h1> Your Rank: <?php echo $rank; if ($rank==9999) { echo " (Admin)"; } if ($rank==999) { echo " (Performer)"; } if ($rank==99) { echo " (Groupie)"; } ?></font><br> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class='tableborder' height=100% text="#000000"> <tr> <td width=20% valign=top> <div class='maintitle'><center>Main Links</center></div><br> <a href="../member-index.php?src=home">Home</a><br> <a href="../member-index.php?src=profile">My Profile</a><Br> <a href="../member-index.php?src=members">Memberlist</a><Br> <a href="../member-index.php?src=messages">Message Inbox</a><br> <a href="../logout.php">Logout</a><br> <a href="../admin/index.php?src=home">Admin</a><br> <a href="../arcade/Arcade.php" target="blank">Arcade</a><br> <div class='maintitle'>Admin Links</div><br> <a href='index.php?src=home'>Admin Home</a><br> <a href='index.php?src=newuser'>Make New User</a><br> <a href='index.php?src=members'>List all Users</a><br> <a href='index.php?src=sysmessage'>System Message</a><br> <div class='maintitle'>Arcade Admin</div><br> <a href='index.php?src=arcadeplayers'>List Playerlist</a><br> <a href='index.php?src=arcadegames'>List Games</a><br> </td> <td width=80%> <table width=100% height=100%><tr> <iframe src="<? echo $src; ?>" width=100% height=500 name="adminWindow"></iframe> </td> </tr></table> <?php ++$i; } ?> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/187426-parse-errors/#findComment-989729 Share on other sites More sharing options...
PFMaBiSmAd Posted January 6, 2010 Share Posted January 6, 2010 Someone already suggested in one of your threads how you can find parse errors on a server where you don't have access to the master php.ini - You can set those two settings in a .htaccess file (when php is running as an apache module) or in a local php.ini (when php is running as a CGI application.) Quote Link to comment https://forums.phpfreaks.com/topic/187426-parse-errors/#findComment-989737 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.