1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Passing Variables in Header call

Discussion in 'PHP' started by msullivan3, Apr 27, 2009.

  1. msullivan3

    msullivan3 New Member

    Joined:
    Apr 27, 2009
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    The certain webpage I have has a username that is passed from a form on a different page. All I simply want to do is pass the same variable along to the next page when I call: header( 'Location: admin.php' ) ;

    Is there a better way of going to a next page or is there an easy way to pass a variable along with this call?
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    3 ways you can get them in the new location

    1. Passing with the URLs
    2. Setting the session
    3. Setting the cookie
     
  3. msullivan3

    msullivan3 New Member

    Joined:
    Apr 27, 2009
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    thanks shabbir. i ended up using the cookie method.
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    Thats great
     

Share This Page