开发者

session username match to

开发者 https://www.devze.com 2023-03-02 09:07 出处:网络
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\']; ?>

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 } ?>
0

精彩评论

暂无评论...
验证码 换一张
取 消