21.09.2011, 20:14
Hi, I am wanting to make a dynamic webpage which is for me only, I want to use it to promote / demote administrators from my SA:MP server. I know I am doing something wrong but I can't quite put my finger on it. Here is my full code which I am wanting to use.
I'm sorry about the indentation of my code but any help is appreciated.
Код:
echo "<td class='info' width=50% align='center'>"; echo '<a href="http://foxxrp.com/ucp/admins.php?demoteid=' . $row['Name'] . '">' . 'X' . '</a>'; echo "</td>"; echo "<td class='info' width=50% align='center'>"; echo '<a href="http://foxxrp.com/ucp/admins.php?promoteid=' . $row['Name'] . '">' . 'X' . '</a>'; echo "</td>"; echo "</tr>"; } } $result = mysql_query("SELECT * FROM `accounts`"); $row = mysql_fetch_array($result, $con); if($_GET['demoteid'] == $row['Name']) { $user = $_GET['demoteid']; $admin = --$row['Admin']; echo 'You have demoted '.$user.' to level '.$admin.''; $query = 'UPDATE `accounts` SET `Admin` = '.--$admin.' WHERE `Name` = '.$user.''; } if($_GET['promoteid'] == $row['Name']) { $user = $_GET['promoteid']; $admin = ++$row['Admin']; echo 'You have promoted '.$user.' to level '.$admin.''; $query = 'UPDATE `accounts` SET `Admin` = '.++$admin.' WHERE `Name` = '.$user.''; } mysql_query($query); ?>