Jump to content

[SOLVED] Restricting Access to a Link, HELP.


SauloA

Recommended Posts

I have a cell in my table where I want to make a link that sends the user to another page on my site.  I want the text in my cell to appear as a link depending on a users access level.  If the user has an access level of 2 there shouldn't be a link otherwise the link does display.

Here's some code I've been working on that doesn't work, but is kind of the concept that I want.  I'd appreciate the help.

<?php
if (!(strcmp($_SESSION['MM_UserLevel'],2))) {

echo $row_rsReviews['urev_id'];

} else {

<a href="editreviews.php?revID=<?php echo $row_rsReviews['urev_id']; ?>"><?php echo $row_rsReviews['urev_date']; ?></a>

}
?>

The problem is most likely everything after the else statement, but since I'm kinda new to PHP I wouldn't know.
Link to comment
Share on other sites

You never closed your PHP before starting the HTML
change to
[code]} else {
?><a href="editreviews.php?revID=<?php echo $row_rsReviews['urev_id']; ?>"><?php echo $row_rsReviews['urev_date']; ?>[/url]<?php
}[/code]


Not sure what the url code is for.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.