pthurmond Posted November 12, 2006 Share Posted November 12, 2006 I want to know if there is a way to pass a value to a script depending on which link you click on.I am doing this for a report generation system and want to use the same script for two different reports. Both search for a person based on the first and last names, but they search different tables on the same db. I have two links on the same page and I want to just link to the same script, telling the script which link was clicked so I knows which table to search. Is this possible?Thanks,Patrick Link to comment https://forums.phpfreaks.com/topic/27038-passing-values-with-links/ Share on other sites More sharing options...
trq Posted November 12, 2006 Share Posted November 12, 2006 [code]<a href="page.php?link=1">link 1</a><a href="page.php?link=2">link 2</a>[/code]Then in page.php.[code]<?php if (isset($_GET['link'])) { echo "You clicked on link {$_GET['link']}"; }?>[/code] Link to comment https://forums.phpfreaks.com/topic/27038-passing-values-with-links/#findComment-123650 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.