Page 1 of 1

Detecting A Link Click

Posted: Sun Sep 02, 2007 10:12 am
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.

Posted: Sun Sep 02, 2007 10:23 am
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>