SauloA Posted January 27, 2007 Share Posted January 27, 2007 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. Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 27, 2007 Share Posted January 27, 2007 You never closed your PHP before starting the HTMLchange 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. Quote Link to comment Share on other sites More sharing options...
SauloA Posted January 27, 2007 Author Share Posted January 27, 2007 I took off the "[/url]" from you code and also you forgot to end if with "?>" so I added it. Other then what I listed, the code worked exactly how I wanted. Thanks a bunch. Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 27, 2007 Share Posted January 27, 2007 The "[/url]" was in YOUR code.You're welcome. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.