Jump to content

[SOLVED] How to determine which link was clicked?


coder9

Recommended Posts

<?php
if( $_GET['link']=='1' ){
    echo "You Selected Link 1!";
}

if( $_GET['link']=='2' ){
    echo "You Selected Link 2!";
}
?>

<a href="page.php?link=1">Link 1</a>
<a href="page.php?link=2">Link 2</a>

 

assuming you name the php file page.php

<?php
if( $_GET['link']=='1' ){
    echo "You Selected Link 1!";
}

if( $_GET['link']=='2' ){
    echo "You Selected Link 2!";
}
?>

<a href="page.php?link=1">Link 1</a>
<a href="page.php?link=2">Link 2</a>

 

assuming you name the php file page.php

 

 

Thanks man you are very helpful.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.