PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm trying to pass a variable from one page to another but having a difficult time doing so. I have two pages. Page 1 pulls data in from a database and displays it. Page 2 is simply the "more detailed info" type page that gets displayed when the mouse is hovered over the results ( in a tooltip kind of fashion ). Now, the mouse-hovering and detailed info works great. The only problem i am having is not being able to pass the $id from Page1 to Page2 where it can show this info automatically cause right now, in Page2, i have to type in the $id manually ( eg : $id = 32 ) to get a result.
Do you want
a) to pass an id with each url so details are displayed according to the link that was activated/clicked?
b) to store one id in the session data so that no matter what link was clicked the details of this one record is displayed?
c) both?
Last edited by volka on Mon Jan 22, 2007 1:27 pm, edited 2 times in total.
Using $_SESSION still only displays details of the first record inside the tooltip, even with it inside the while-loop. I guess it does not refresh itself ( static ) when i hover my mouse over a different result.
Do you want
a) to pass an id with each url so details are displayed according to the link that was activated/clicked?
I guess that is what i am trying to do. However, the link does not get clicked, it gets hovered over, displaying the detailed tooltip. As i mentioned, so far i am able to retreive the detailed info, but only if i specify the id myself.
Do you want
a) to pass an id with each url so details are displayed according to the link that was activated/clicked?
I guess that is what i am trying to do. However, the link does not get clicked, it gets hovered over, displaying the detailed tooltip. As i mentioned, so far i am able to retreive the detailed info, but only if i specify the id myself.
and use $_GET['id'] to retrieve the value of the variable.
Stupid question, but how do i make my url like that if i am not clicking on the results, but hovering over them with my mouse? Or maybe your suggestion is unclear to me.
Anyways i did try as u suggested but to no avail.
Page 1's url is like so : http://site/?w=result while Page 2's url is not attached in this way. it is accessed as just 'tooltip.php'.
tarja311 wrote:
Stupid question, but how do i make my url like that if i am not clicking on the results, but hovering over them with my mouse? Or maybe your suggestion is unclear to me.
Anyways i did try as u suggested but to no avail.
Page 1's url is like so : http://site/?w=result while Page 2's url is not attached in this way. it is accessed as just 'tooltip.php'.
if you can load tooltip.php, why not tooltip.php?id=20