justuptime.com - monitor your servers & websites

pass $_POST data into popup window

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

They have: 53 posts

Joined: Oct 2005

Hi all!
I have a page (generated with PHP) that has a list of employee names. What I want to do is, when the user hits on each name, a pop-up window (using Javascript) to appear which will say some more details on the employee (i.e his age, job experience etc).
So I thought I make a form for each employee name, and use hidden fields to pass the info I want.
For example

With the above, I show a little example of course. What I have is a submit button with John's name written in it and I want, when the user clicks on John, a pop-up window to appear and contain the "hidden" values of age and experience in it.
I don't know much about Javascript, i tried usind the document.write function, but no luck. I can only "send" data to the next page that are written in an input field, but not data that are written in hidden fields...
Any thoughts?

Greg K's picture
Moderator

He has: 1,601 posts

Joined: Nov 2003

why no just do a regular link such as:

<?php
<a href="http://www.domain.com/details.php?age=23;&exp=expert&name=John\">John</a>
?>

then in details.php just grab the values from the $_POST[] array ($_POST['age'] $_POST['exp'] $_POST['name'] )

-Greg

[This space intentionally left blank]

Cool Geek Supplies: www.ThinkGeek.com

dk01's picture

He has: 517 posts

Joined: Mar 2002

Those would actually be _GET vars Greg.

Greg K's picture
Moderator

He has: 1,601 posts

Joined: Nov 2003

oops, my bad. You are right Smiling

So my method my not be a good solution, as they may have been wanting it to actually not be in a query string.

To actually do it as a $_POST, then you do have to use as a form as the example given orginally.

-Greg

[This space intentionally left blank]

Cool Geek Supplies: www.ThinkGeek.com