Detecting A Link Click

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kkonline
Forum Contributor
Posts: 251
Joined: Thu Aug 16, 2007 12:54 am

Detecting A Link Click

Post by kkonline »

I am working on an article manager. For that i now need to work on add and view comment part to the article.

In case of form system, we have submit button with a value which is checked using

Code: Select all

isset($_POST['done'] && strlen($_POST['done'])>0)
and so on...

Now is there any way i can detect/check if the user has pressed the link (say link to comment.php or showcomment.php). And if he has pressed then i would show the comments or give him a comment box accordingly on the current page.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Same as with _POST only with _GET.

Code: Select all

<html>
  <head><title>...</title></head>
  <body>
    <?php if (isset($_GET['x'])) echo $_GET['x'], "<br />\n"; ?>
    <a href="?x=1">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</a>
    <br />
    <a href="?x=2">Fusce eu justo dapibus odio mattis dapibus.</a>
  </body>
</html>
Post Reply