so you want to switch from being staff to becoming a regular member but be able to go back to being staff once finished ??
using the same user account
you could do this
<?PHP
include "globals.php";
switch($_GET['action'])
{
case 'become_member':
become_member();
break;
case 'become_admin':
become_admin();
break;
case 'become_moderator':
become_moderator();
break;
default:
prefs_home();
break;
}
function prefs_home()
{
global $db,$ir,$c,$userid,$h;
print "<h3>Your Staff Status Page</h3>
<a href='?action=become_member'><h3>Become a normal game player</a></h3>
<a href='?action=become_admin'><h3>Become Game Admin</a></h3>
<a href='?action=become_moderator'><h3>Become Game Moderator</a></h3>
";
}
function become_member()
{
global $db,$ir,$c,$userid,$h;
$db->query("UPDATE users SET user_level=3 WHERE userid=$userid");
Print"<h3>You have now become a Normal User</h3><br><br><a href='RENAME ME.php'>Return To Choices</a></h3>";
}
function become_admin()
{
global $db,$ir,$c,$userid,$h;
$db->query("UPDATE users SET user_level=2 WHERE userid=$userid");
Print"<h3>You have now become an Admin</h3><br><br><a href='RENAME ME.php'>Return To Choices</a></h3>";
}
function become_moderator()
{
global $db,$ir,$c,$userid,$h;
$db->query("UPDATE users SET user_level=3 WHERE userid=$userid");
Print"<h3>You have now become a Moderator</h3><br><br><a href='RENAME ME.php'>Return To Choices</a></h3>";
}
just alter the RENAME ME.php to anyname your new file is gping to be called