Whether a link is clicked or not?

Just like as we check whether a link is clicked or not, as follows

if (isset($_POST['btnSubmit'])) {
		//Do something.
}

In the same way I just want to check whether a particular link is clicked or not.

??? :mad: :mad: :mad:

Just add a variable to link and check for it’s presence…


<a href="myPage.php?myLinkVar1">LinkVar1</a>
<a href="myPage.php?myLinkVar2">LinkVar2</a>
<a href="myPage.php?myLinkVar3">LinkVar3</a>

And then retrieve it using $_GET


if(isset($_GET['myLinkVar1'])) {
    // do something
}

Why not just use

$_SERVER["REQUEST_URI"];

?

Wot does it return?

and which link should I click?

My page is as follows:

<html>
	<head>
		<?php include("../Modules/Title.php");?>
	    <link href="CSS/CyberSearch_AdminPanel.css" rel="stylesheet" type="text/css">
	</head>
	
<body>
<?php
			if(isset($_POST['logout']))
			{
				echo "link";
			}
		?>
<form name="Form1" method="post">
  <a href="#" name="logout" onClick="Form1.submit();">Hello</a>

</form>
</body>
</html>