Passing variables from page to page

os242

New Member
Messages
46
Reaction score
0
Points
0
Hi there:

I have a page (page1.php) where I use a list box (box1) with dynamic content where project names are displayed from a sql query to a table and I have a text field (text1) where the user inputs the project password; once project name has been selected and the password entered the user click a submit button; I use a 'form action = page2.php' where in such page I validate the password, if the password is right I take the user to a specific page where I want the selected project password (from box1) to be passed to a text field (text3) in another page (page3.php).

Then what I do is next:

in page1.php to have the list box (box1) and text field (text1) and a submit button.

in page2.php I use post method $PNAME=$_POST['PNAME']; $PPASS=$_POST['PPASS']; to get user inputs.

in page3.php I have a textfield (text3) where I defined it as: <input name="PNAME" type="text" id="PNAME" value="<?php $submitted_text =$_POST['PNAME']; echo $submitted_text; ?>"/>

when I run it, it tells me that PNAME has not been defined.

Any hints?

Thanks!
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
205
Points
63
Moving this to site management.

Is your method set to post on the form? Try doing print_r($_REQUEST); at the top of the page it is posting to so you can see what is being sent to it.

-Corey
 

swirly

Active Member
Messages
1,930
Reaction score
0
Points
36
try setting them all on one page or something. have one page store the variables and the others pull them from that page.
 

os242

New Member
Messages
46
Reaction score
0
Points
0
Thanks for you inputs:

By using: print_r($_REQUEST); I get Array ( [PHPSESSID] => 70qckvr0fvijjpv738n3iu1i25 ) that I do not know what does it mean and how to deal with it.

By puting everything on one page I created a function to check the password (checkpass) and I call it in <form action="checkpass" method="post" form name="theform">, when I run it the browser display a blank page with the message: The webpage cannot be found

Any hints? thanks alot for your help!
 
Top