boney alex Posted April 12, 2007 Share Posted April 12, 2007 Hi all, very new to PHP and I've got a dead simple question. Ive managed to display my records in a table, with a link called 'Cancel' next to get row. When the user selects cancel I would like to open cancel.php and gather all the information regarding the ID for that row. I have the following code: <?php while ($reservation = mysql_fetch_array($query)) { $reservationid = $reservation['ReservationID']; $make = $reservation['Make']; $model = $reservation['Model']; $spec = $reservation['Specification']; $collectiondate = $reservation['Collection_Date']; $returndate = $reservation['Return_Date']; $cost = $reservation['Cost']; echo (" <tr> <td> <font face=Arial>$reservationid</font> </td> <td> <font face=Arial>$make</font> </td> <td> <font face=Arial>$model</font> </td> <td> <font face=Arial>$spec</font> </td> <td> <font face=Arial>$collectiondate</font> </td> <td> <font face=Arial>$returndate</font> </td> <td> <font face=Arial>$cost</font> </td> <td> <a href=\"cancel.php?id=$reservationid\">Cancel</a> </td> </tr> ?> On cancel.php, how do I get the id=$reservationid??? Thanks Link to comment https://forums.phpfreaks.com/topic/46714-solved-how-do-i-grab-this-link-id/ Share on other sites More sharing options...
obsidian Posted April 12, 2007 Share Posted April 12, 2007 Since you're passing it through the URL, just use $_GET: <?php $id = $_GET['id']; ?> Link to comment https://forums.phpfreaks.com/topic/46714-solved-how-do-i-grab-this-link-id/#findComment-227566 Share on other sites More sharing options...
boney alex Posted April 12, 2007 Author Share Posted April 12, 2007 cheers mate! Link to comment https://forums.phpfreaks.com/topic/46714-solved-how-do-i-grab-this-link-id/#findComment-227569 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.