+ Reply to Thread
Results 1 to 4 of 4

Thread: Passing variables from page to page

  1. #1
    os242 is offline x10Hosting Member os242 is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    46

    Passing variables from page to page

    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!

  2. #2
    Corey's Avatar
    Corey is offline VPS Migration Professional Corey is a glorious beacon of lightCorey is a glorious beacon of light
    Join Date
    Dec 2004
    Location
    Northfield, NH
    Posts
    17,151

    Re: Passing variables from page to page

    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

  3. #3
    swirly's Avatar
    swirly is offline x10 Elder swirly is an unknown quantity at this point
    Join Date
    Jul 2005
    Location
    NC
    Posts
    965

    Re: Passing variables from page to page

    try setting them all on one page or something. have one page store the variables and the others pull them from that page.
    Don't go to bed angry, stay awake and plot revenge.

  4. #4
    os242 is offline x10Hosting Member os242 is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    46

    Re: Passing variables from page to page

    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!

+ Reply to Thread

Similar Threads

  1. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  2. Replies: 1
    Last Post: 09-05-2006, 06:53 PM
  3. Ads on Every Page?
    By ThaoD in forum Free Hosting
    Replies: 5
    Last Post: 08-23-2005, 05:44 PM
  4. Cannot edit in Front Page
    By katyW in forum Free Hosting
    Replies: 9
    Last Post: 05-26-2005, 06:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers