Dynamic Webpages [Need help ASAP!]
#3

Solution
PHP код:
if(isset($_GET['demoteid'])) $user addslashes($_GET['demoteid']); // don't never let user direct control
if(isset($_GET['promoteid'])) $user addslashes($_GET['demoteid']);
$result mysql_query("SELECT * FROM `accounts` WHERE Name= '$user'"); 
$row mysql_fetch_array($result$con);
if(isset(
$_GET['demoteid']))
{
    
$admin = --$row['Admin'];
    echo 
'You have demoted '.$user.' to level '.$admin.'';
    
$query 'UPDATE `accounts` SET `Admin` = '.--$admin.' WHERE `Name` = '.$user.'';
}
if(isset(
$_GET['promoteid']))
{
    
$admin = ++$row['Admin'];
    
    echo 
'You have promoted '.$user.' to level '.$admin.'';
    
$query 'UPDATE `accounts` SET `Admin` = '.++$admin.' WHERE `Name` = '.$user.'';

I may like OOP this but yeah your opinion. Thats should be work - not sure tell when it's don't work
Reply


Messages In This Thread
Dynamic Webpages [Need help ASAP!] - by Luis- - 21.09.2011, 20:14
Re: Dynamic Webpages [Need help ASAP!] - by whitedragon - 21.09.2011, 20:41
Re: Dynamic Webpages [Need help ASAP!] - by whitedragon - 22.09.2011, 09:18
Re: Dynamic Webpages [Need help ASAP!] - by Luis- - 22.09.2011, 19:40
Re: Dynamic Webpages [Need help ASAP!] - by Luis- - 22.09.2011, 23:18
Re: Dynamic Webpages [Need help ASAP!] - by ca2k - 23.09.2011, 09:55
Re: Dynamic Webpages [Need help ASAP!] - by whitedragon - 23.09.2011, 13:01

Forum Jump:


Users browsing this thread: 1 Guest(s)