priyankabhar Posted November 13, 2009 Share Posted November 13, 2009 Hi All, I have my php to print out table for me, and each row data in the table is a link. I have done this much. Now, in the next step, I need to be able to click a link from the table and another table with some information about the link is supposed to appear at the bottom of the same page. I am not sure how I can use php to know which table row data (link) I clicked, so that the corresponding information can be echoed out on the new table below. <tr> <td> <?php echo $movieCounter ?> </td> <td> <div id="movieLink"><a href="#MovieSection"> <?php echo $movieName ?></a></div></td> <td> <div id="movieLink"><a href="#"><?php echo $movieID ?> </a></div></td> <td> <?php echo $movieStatus ?> </td> </tr> This is how the link is created. It is inside a for loop. So there are 5 links ( 5 movie names) that will be created. I need to be able to click on a movie name, and the corresponding informations about the movie should appear in the bottom. I am not sure how I can trace which movie name was clicked so that I could fetch its information from database? Any help would be greatly appreciated. Thanks a lot. Priya Link to comment https://forums.phpfreaks.com/topic/181411-how-can-php-know-which-link-was-clicked-help/ Share on other sites More sharing options...
dropfaith Posted November 13, 2009 Share Posted November 13, 2009 it would look something like this <a href="moviename.php?Id=<?php echo $row->moviename; ?> [code] however for it to be on the same page i do believe your going to need some ajax as well Link to comment https://forums.phpfreaks.com/topic/181411-how-can-php-know-which-link-was-clicked-help/#findComment-956974 Share on other sites More sharing options...
priyankabhar Posted November 13, 2009 Author Share Posted November 13, 2009 I am pretty new to php, so I could not understand your code clearly. Still looking for help. Link to comment https://forums.phpfreaks.com/topic/181411-how-can-php-know-which-link-was-clicked-help/#findComment-957122 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.