Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP adding two arguments in order to display data.

Status
Not open for further replies.

dreamaz

Technical User
Dec 18, 2002
184
CA
Hi ,

Sorry i am new to php. I have a secure site that logs in a user with a session file. I also have a database with articles and a field for each article with PRIVATE=YES/NO.

Basically what i would like is if the user is logged in with his own ID which is classified by ROLE (1 or 2) if they are a user with role 1 AND the article queried is PRIVATE then show the data otherwise no results are displayed.

So currently I have something like this to hide a particular link on my site:

<?php if ($_SESSION['chart'][ 'Search' ][ 'View' ] ) { echo $link } ?>

i would like to add to the argument to somthing like this

<?php if ($_SESSION['chart'][ 'Search' ][ 'View' ] AND $row_GetSearch['private'] == 'YES') { echo $link } ?>

Is that possible?

Any help is apprecaited

thanks,
dR
 
Code:
<?php if (($_SESSION['chart'][ 'Search' ][ 'View' ]) && ($row_GetSearch['private'] == 'YES')) { echo $link } ?>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top