pass $_POST data into popup window
Posted 18 April 2006 - 09:56 PM
So I thought I make a form for each employee name, and use hidden fields to pass the info I want.
<input type="hidden" name ="age" value="23 years old">
<input type="hidden" name="experience" value="expert">
<input type="submit" value="John">
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.
Posted 01 May 2006 - 02:04 AM
[a href=\"http://www.site.com/page2.php?age=23\" target=\"_blank\"]http://www.site.com/page2.php?age=23[/a] years old&experience=expert
where page2 would be the popup page. then, to print those, simply call the variable in your php script like so:
<?php print(" John is $age and is a(n) $experience. "); ?>
Option number two:
use the post method in your form and the variables will be kinda hidden. to access these ones, do the following:
<?php $age = $_POST['age']; $experience = $_POST['experience']; print(" John is $age and is a(n) $experience. "); ?>
whereas in the single quotes of this: $_POST['']; you put whatever the name of the field thats getting posted is.
This is only my second post here, so I hope imnot too confusing. the examples should help atleast. And i hope I understood the question and answered it so you can learn and finish your project. enjoy!
Posted 01 May 2006 - 06:58 AM
<form action="http://www.phpfreaks.com/" method="post" onSubmit="win=window.open('','janela','toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width=860,height=600,left = 80,top = 40'); this.target='janela';"> <input type="submit" value="test submit"> </form>
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users