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
https://forums.phpfreaks.com/topic/35909-solved-restricting-access-to-a-link-help/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.