session username match to
So when a logged on user posts a comment on my webpage, it automatical开发者_开发技巧ly posts their username next to their comment. using <? echo $rows['a_name']; ?>
I now want to create an edit link that will only appear on the posts that the logged in user has created. In other words I want to match the <? echo $rows['a_name']; ?>
to the $_SESSION=['username']
username and if they match - display the edit link -... if not, then hide the edit link.
Any help, examples, ideas?
<?php if($rows['a_name']===$_SESSION['username']) { ?>
<!-- edit link here -->
<?php } ?>
精彩评论