Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

How to check if an admin

Asked Modified Viewed 1,996 times
S
slpctrl
S
  • Junior Member, joined since
  • Contributed 46 posts on the community forums.
  • Started 24 threads in the forums
  • Started this discussions
asked
Junior Member

Hello, I have a code bank on my website, and I need an admin to be able to modify and delete code. Here is the line I'm working with:

if (isset($userdata['user_id']) && $userdata['user_id'] == $writerId)
  {
      opentable("Manage code");
    echo ('<div style="text-align: center;"><form method="post" action="submitcode.php"><input type="hidden" value="'.$id.'" name="code" /><input type="submit" name="edit" value="Edit Code" class="button" /></form></div>');
    $result = mysql_query("SELECT id,name FROM KeyeD_codename");
    echo "<div style=\"text-align: center;\"><form method=\"post\" action=\"codebank.php?type=".$row['Type']."\"><input type=\"hidden\" value=\"".$id."\" name=\"code\" /><input type=\"submit\" name=\"delete\" value=\"Delete Code\" class=\"button\" /></form>   \n";
     
      echo "</div>";
      closetable();
  }
  else{
  }
}


Now, how would I take that a step further so that if you're an admin, you can also have the right to modify that code? Thanks.
Edited by slpctrl on 28-04-2009 00:45,
0 replies

4 posts

S
slpctrl
S
  • Junior Member, joined since
  • Contributed 46 posts on the community forums.
  • Started 24 threads in the forums
  • Started this discussions
answered
Junior Member

Never mind; I got it.
0 replies
B
Basti
B
Basti 10
[PHP-Fusion Crew Member & Admin from June 2008 - December 2010]

http://basti2web.de - Support Site for my infusions
  • Veteran Member, joined since
  • Contributed 1,099 posts on the community forums.
  • Started 32 threads in the forums
answered
Veteran Member

You can use iADMIN
if(iADMIN) echo "You are admin";
0 replies
S
slpctrl
S
  • Junior Member, joined since
  • Contributed 46 posts on the community forums.
  • Started 24 threads in the forums
  • Started this discussions
answered
Junior Member

Quote

slaughter wrote:
You can use iADMIN
if(iADMIN) echo "You are admin";


This is a much better method, thanks :).
0 replies
B
Basti
B
Basti 10
[PHP-Fusion Crew Member & Admin from June 2008 - December 2010]

http://basti2web.de - Support Site for my infusions
  • Veteran Member, joined since
  • Contributed 1,099 posts on the community forums.
  • Started 32 threads in the forums
answered
Veteran Member

no problem ;)
0 replies

Category Forum

User Administration - 8

Labels

None yet

Statistics

  • Views 0 views
  • Posts 4 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

B
B
Basti 10
[PHP-Fusion Crew Member & Admin from June 2008 - December 2010]

http://basti2web.de - Support Site for my infusions
  • Veteran Member, joined since
  • Contributed 1,099 posts on the community forums.
  • Started 32 threads in the forums
S
S
  • Junior Member, joined since
  • Contributed 46 posts on the community forums.
  • Started 24 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet