Passing a variable between 3 pages

Discussion in 'PHP' started by timallard, Aug 14, 2007.

  1. #1
    Hello!

    Here is my situation.

    I have 3 page. The first page is only a dropdown menu Where the user chooses a value. The next page does some processing, and the final page does some more processing. That final page needs that chosen variable from the first page...how can i grab that?

    I know how to pass variables between 2 pages,..but not 3...i hope this can be done without sessions.

    -Thanks!!
     
    timallard, Aug 14, 2007 IP
  2. killerj

    killerj Active Member

    Messages:
    765
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    95
    #2
    use the <input type=hidden> tag ;)
    From page 1 , grab the variable using $_POST
    ex in page 2 :
    $something = $_POST['value'];
    In the form area of page 2 , add this
    <input type= hidden name=blah value = <? echo $something ?> >
    That way , in page 3 , you have the variable
    $something2 = $_POST['blah'] ;
    hope you'll get an idea about how it works ;)
    Good luck.
     
    killerj, Aug 14, 2007 IP
    timallard likes this.
  3. timallard

    timallard Well-Known Member

    Messages:
    1,634
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    158
    #3
    You my friend, are a life saver! thank you! Rep for you!
     
    timallard, Aug 14, 2007 IP
  4. killerj

    killerj Active Member

    Messages:
    765
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    95
    #4
    Thanks a lot :)
    I'm glad i was a help to you & good luck with your website.
     
    killerj, Aug 14, 2007 IP