Jump to content

What does this error mean?


Drezard

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.