Session Variable Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • arenaTR

    Session Variable Problem

    I'm getting a little frustrated w/ PHP. I have the following sequence:

    page 1 gets input from user, calls script 1
    script 1 sets session variables from page 1 POST with:
    $_SESSION['email'] = $_POST['EMAIL']
    $_SESSION['link'] = [mysql link]
    script 1 calls page 2
    page 2 takes in more data and calls script 2
    script 2 gets session variables set in script 1 but errors out with:

    Notice: Undefined variable: _SESSION in p1info.php on line 30

    HELP:? This seemed so simple from the manuals but now it's just now working
    and it doesn't make any sense. Your help is, as always, greatly
    appreciated.


  • Pedro Graca

    #2
    Re: Session Variable Problem

    arenaTR wrote:[color=blue]
    > I'm getting a little frustrated w/ PHP. I have the following sequence:
    >
    > page 1 gets input from user, calls script 1[/color]

    through the action attribute of the form, right?
    [color=blue]
    > script 1 sets session variables from page 1 POST with:
    > $_SESSION['email'] = $_POST['EMAIL']
    > $_SESSION['link'] = [mysql link][/color]

    I'm not sure saving the resource returned from mysql_connect() works, in
    fact, I'm almost certain it doesn't.
    [color=blue]
    > script 1 calls page 2[/color]

    What do you mean "calls page 2"?
    Redirects with a header() call?
    [color=blue]
    > page 2 takes in more data and calls script 2[/color]

    through the action attribute of the form, right?
    [color=blue]
    > script 2 gets session variables set in script 1 but errors out with:
    >
    > Notice: Undefined variable: _SESSION in p1info.php on line 30[/color]

    Did you do a session_start() in this script 2 (p1info.php)?
    --
    --= my mail box only accepts =--
    --= Content-Type: text/plain =--
    --= Size below 10001 bytes =--

    Comment

    Working...