coder9 Posted July 17, 2008 Share Posted July 17, 2008 hello brothers let say i have two links Link1 and Link2 that is on the same page. How does PHP determine which link was clicked. any sample script? I know this is very simple i'm just only lost right now. thanks. Link to comment https://forums.phpfreaks.com/topic/115160-solved-how-to-determine-which-link-was-clicked/ Share on other sites More sharing options...
cooldude832 Posted July 17, 2008 Share Posted July 17, 2008 use a get variable to transfer additional data. Link to comment https://forums.phpfreaks.com/topic/115160-solved-how-to-determine-which-link-was-clicked/#findComment-592178 Share on other sites More sharing options...
coder9 Posted July 17, 2008 Author Share Posted July 17, 2008 use a get variable to transfer additional data. thanks cooldude832 can you show me a very basic sample of the get please. Link to comment https://forums.phpfreaks.com/topic/115160-solved-how-to-determine-which-link-was-clicked/#findComment-592181 Share on other sites More sharing options...
l0ve2hat3 Posted July 17, 2008 Share Posted July 17, 2008 <?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 Link to comment https://forums.phpfreaks.com/topic/115160-solved-how-to-determine-which-link-was-clicked/#findComment-592186 Share on other sites More sharing options...
coder9 Posted July 17, 2008 Author Share Posted July 17, 2008 <?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. Link to comment https://forums.phpfreaks.com/topic/115160-solved-how-to-determine-which-link-was-clicked/#findComment-592217 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.