Drezard Posted March 8, 2007 Share Posted March 8, 2007 Hello, What does this PHP error mean? Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /home/wintersw/public_html/includes/admin.php - Cheers, Daniel Link to comment https://forums.phpfreaks.com/topic/41763-what-does-this-error-mean/ Share on other sites More sharing options...
rofl90 Posted March 8, 2007 Share Posted March 8, 2007 admin.php has an unexpected ';' probably you've entered it twice look for mistakes r show here and ll lok through fr you. Link to comment https://forums.phpfreaks.com/topic/41763-what-does-this-error-mean/#findComment-202464 Share on other sites More sharing options...
Drezard Posted March 8, 2007 Author Share Posted March 8, 2007 Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /home/wintersw/public_html/includes/admin.php on line 303 Ill have alook now aswell. <?php class ADMIN { var $priv; function admin_viewpanel() { if (!isset($_SESSION['userinfo'])) { echo "You need to be logged in to view this"; } if (isset($_SESSION['userinfo'])) { $session_array = explode(" ", $_SESSION['userinfo']); $user = $session_array[0]; $query = "SELECT priv FROM user_ids WHERE user='$user'"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); if (mysql_num_rows($result) > 0) { while(list($priv) = mysql_fetch_row($result)) { $this->priv = $priv; } } if ($this->priv != 7) { echo "You don't have the permission to view this"; } if ($this->priv == 7) { echo "<a href='admin_viewusers.php'><img border='0' src='images/admin_viewdatabase.gif' width='49' height='48'> <a> <br>"; echo "<span class='style2'><a href='admin_viewusers.php'>User Edit</a></span>"; } } } function admin_viewusers() { if (!isset($_SESSION['userinfo'])) { echo "You need to be logged in to view this"; } if (isset($_SESSION['userinfo'])) { $session_array = explode(" ", $_SESSION['userinfo']); $user = $session_array[0]; $query = "SELECT priv FROM user_ids WHERE user='$user'"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); if (mysql_num_rows($result) > 0) { while(list($priv) = mysql_fetch_row($result)) { $this->priv = $priv; } } if ($this->priv != 7) { echo "You don't have the permission to view this"; } if ($this->priv == 7) { echo "USER PASS PRIV TIMESTAMP<br> <br>"; $query = "SELECT user, password, priv, timestamp FROM user_ids"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); if (mysql_num_rows($result) > 0) { while($row = mysql_fetch_row($result)) { echo "$row[0] - "; echo "$row[1] - "; echo "$row[2] - "; echo "$row[3] <a href='admin_editusers.php?user=$row[0]'>User Edit</a> <br>"; } } else { echo "No rows found!"; } } } } function admin_edituser() { if (!isset($_SESSION['userinfo'])) { echo "You need to be logged in to view this"; } if (isset($_SESSION['userinfo'])) { $session_array = explode(" ", $_SESSION['userinfo']); $user = $session_array[0]; $query = "SELECT priv FROM user_ids WHERE user='$user'"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); if (mysql_num_rows($result) > 0) { while(list($priv) = mysql_fetch_row($result)) { $this->priv = $priv; } } if ($this->priv != 7) { echo "You don't have the permission to view this"; } if ($this->priv == 7) { if (!isset($_GET['user'])) { echo "<meta http-equiv='refresh' content='0;url=admin_view_users.php'>"; } if (isset($_GET['user'])) { $user = $_GET['user']; if (!isset($_POST['pass'])) { $query = "SELECT password, priv FROM user_ids WHERE user='$user'"; $result_ids = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); $query = "SELECT email FROM user_profiles WHERE user='$user'"; $result_profiles = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); $query = "SELECT strength, dexerity, constitution, intelligence, level FROM user_charinfo WHERE user='$user'"; $result_stats = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); $query = "SELECT exp_cur, exp_max, hp_cur, hp_max, mp_cur, mp_max, skill_1, skill_2, skill_3, skill_4, skill_5, money FROM user_currents WHERE user='$user'"; $result_currents = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); if (mysql_num_rows($result_ids) > 0) { while($row_ids = mysql_fetch_row($result_ids)) { if (mysql_num_rows($result_profiles) > 0) { while($row_profiles = mysql_fetch_row($result_profiles)) { if (mysql_num_rows($result_stats) > 0) { while($row_stats = mysql_fetch_row($result_stats)) { if (mysql_num_rows($result_currents) > 0) { while($row_currents = mysql_fetch_row($result_currents)) { echo "Editing user: $user <br> <br>"; echo "<form action='' method='post'> Password: <input type='text' name='pass' value='$row_ids[0]'><br> Priv: <select name='priv' value='$row_ids[1]'> <option value='1'>User</option> <option value='5'>Coder</option> <option value='6'>Mod</option> <option value='7'>Admin</option> </select><br><br> Email: <input type='text' name='email' value='$row_profiles[0]'><br><br> Strength:<input type='text' name='strength' value='$row_stats[0]'><br> Dexerity:<input type='text' name='dexerity' value='$row_stats[1]'><br> Constitution:<input type='text' name='constitution' value='$row_stats[2]'><br> Intelligence:<input type='text' name='intelligence' value='$row_stats[3]'><br> Level:<input type='text' name='level' value='$row_stats[4]'><br><br> Exprience Current:<input type='text' name='exp_cur' value='$row_currents[0]'><br> Exprience Max:<input type='text' name='exp_max' value='$row_currents[1]'><br> Health Current:<input type='text' name='hp_cur' value='$row_currents[2]'><br> Health Max:<input type='text' name='hp_max' value='$row_currents[3]'><br> Mana Current:<input type='text' name='mp_cur' value='$row_currents[4]'><br> Mana Max:<input type='text' name='mp_max' value='$row_currents[5]'><br> Skill 1:<input type='text' name='skill_1' value='$row_currents[6]'><br> Skill 2:<input type='text' name='skill_2' value='$row_currents[7]'><br> Skill 3:<input type='text' name='skill_3' value='$row_currents[8]'><br> Skill 4:<input type='text' name='skill_4' value='$row_currents[9]'><br> Skill 5:<input type='text' name='skill_5' value='$row_currents[10]'><br> <br> <input type='submit' name='submit'> </form>"; } } } } } } } } if (isset($_POST['pass'])) { $password = $_POST['pass']; $priv = $_POST['priv']; $email = $_POST['email']; $strength = $_POST['strength']; $dexerity = $_POST['dexerity']; $constitution = $_POST['constitution']; $intelligence = $_POST['intelligence']; $level = $_POST['level']; $exp_cur = $_POST['exp_cur']; $exp_max = $_POST['exp_max']; $hp_cur = $_POST['hp_cur']; $hp_max = $_POST['hp_max']; $mp_cur = $_POST['mp_cur']; $mp_max = $_POST['mp_max']; $skill_1 = $_POST['skill_1']; $skill_2 = $_POST['skill_2']; $skill_3 = $_POST['skill_3']; $skill_4 = $_POST['skill_4']; $skill_5 = $_POST['skill_5']; $money = $_POST['money']; $query ="UPDATE user_ids SET password='$password', priv='$priv' WHERE user='$user'"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); $query = "UPDATE user_profiles SET email='$email' WHERE user='$user'"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); $query = "UPDATE user_charinfo SET strength='$strength', dexerity='$dexerity', constitution='$constitution', intelligence='$intelligence', level='$level' WHERE user='$user'"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); $query = "UPDATE users_currents SET exp_cur='$exp_cur', exp_max'$exp_max', hp_cur='$hp_cur', hp_max='hp_max', mp_cur='$mp_cur', mp_max='$mp_max', skill_1='$skill_1', skill_2='$skill_2', skill_3='$skill_3', skill_4='$skill_4', skill_5='$skill_5', money='$money' WHERE user='$user'"; $result_currents = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); echo "User changed"; } } } } } } } ?> Link to comment https://forums.phpfreaks.com/topic/41763-what-does-this-error-mean/#findComment-202471 Share on other sites More sharing options...
rofl90 Posted March 8, 2007 Share Posted March 8, 2007 as yu're using MySQL it didnt com with a lineby any chance thats hundreds of line hep us to help you as thorpe once said could you tell us wheraround etc.. Link to comment https://forums.phpfreaks.com/topic/41763-what-does-this-error-mean/#findComment-202472 Share on other sites More sharing options...
Drezard Posted March 8, 2007 Author Share Posted March 8, 2007 I gave u the full error. Link to comment https://forums.phpfreaks.com/topic/41763-what-does-this-error-mean/#findComment-202483 Share on other sites More sharing options...
rofl90 Posted March 8, 2007 Share Posted March 8, 2007 nice coding b im stuck.. Link to comment https://forums.phpfreaks.com/topic/41763-what-does-this-error-mean/#findComment-202485 Share on other sites More sharing options...
Drezard Posted March 8, 2007 Author Share Posted March 8, 2007 mmmm, me too. I have no clue what is wrong? - Cheers, Daniel Link to comment https://forums.phpfreaks.com/topic/41763-what-does-this-error-mean/#findComment-202489 Share on other sites More sharing options...
rofl90 Posted March 8, 2007 Share Posted March 8, 2007 I hate it when PHP doesn't give you the line.. ctrl + f then src for things like ';;' doubles etc.. normal ';' errors.. Link to comment https://forums.phpfreaks.com/topic/41763-what-does-this-error-mean/#findComment-202490 Share on other sites More sharing options...
Drezard Posted March 9, 2007 Author Share Posted March 9, 2007 I have... Maybe I shall rewrie the script. Any ideas on a faster way to write it (new SQL syntax i could use, some better code?)... Cheers, Daniel Link to comment https://forums.phpfreaks.com/topic/41763-what-does-this-error-mean/#findComment-203243 Share on other sites More sharing options...
btherl Posted March 9, 2007 Share Posted March 9, 2007 I put your script in a file and ran php -l with version 4.3.10 and 5.1.4, and it said your syntax is perfect.. Link to comment https://forums.phpfreaks.com/topic/41763-what-does-this-error-mean/#findComment-203249 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.