Re: [PHP-DB] Hiding Admin Link

[email protected] ("kurokawa tds.net")
Newsgroups php.db
Message-ID <[email protected]>
Easy way to do it is if you use a MySQL database to store it. Do
$username = (name of user);
$admin = mysql_query( "SELECT * FROM usertable WHERE user='$username'" );
if( $admin->admin )
{
    print "<a href='/adminarea'>ADMIN</a>"
}

$username --> variable to hold the name of the user.
$admin --> query to obtain the database row for that user
if() --> checks to see if the "admin status" column of the database is set
to true, if so it prints admin link.

On Thu, Apr 30, 2009 at 9:29 PM, Joey Hendricks
<[email protected]>wrote:

> Hello,
> I am very new at PHP so I will try to explain my question the best I can. I
> was wondering if there was a way to have a link show only to the owner of
> the site? Like having a "Admin" link for editing posts, but hidden to all
> users except the owner. Thank you very much for your time!!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.