Problem with sessions

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

    Problem with sessions

    Hi, I am running a simple application dedicated to verify the sessions
    variables, but it is not working. both transid and trackvars are
    enabled.

    testpage1:

    <?php
    session_start() ;
    session_registe r('session_var' );
    ?>
    <html>
    <head><title>Te sting Sessions page 1</title></head>
    <body>
    <?php
    $session_var = "testing";
    echo "This is a test of the sessions feature.
    <form action='session Test2.php' method='post'>
    <input type='text' name='form_var' value='testing' >
    <input type='submit' value='go to next page'>
    </form>";
    ?>
    </body>
    </html>



    test page 2 :


    <?php
    session_start() ;
    ?>
    <html>
    <head><title>Te sting Sessions page 2</title></head>
    <body>
    <?php
    echo "session_va r = $session_var<br >\n";
    echo "form_var = $form_var<br>\n ";
    ?>
    </body>
    </html>


    any ideas why i get this problem ???

    Notice: Undefined variable: session_var in c:\program
    files\easyphp1-7\www\testsessi ons\sessiontest 2.php on line 8
    session_var =

    Notice: Undefined variable: form_var in c:\program
    files\easyphp1-7\www\testsessi ons\sessiontest 2.php on line 9
    form_var =



    Thank you


    Ben
  • Phil Roberts

    #2
    Re: Problem with sessions

    With total disregard for any kind of safety measures
    microben@hotmai l.com (Ben) leapt forth and uttered:
    [color=blue]
    > Hi, I am running a simple application dedicated to verify the
    > sessions variables, but it is not working. both transid and
    > trackvars are enabled.
    >[/color]

    Have you tried ditching session_registe r() and just using the
    $_SESSION array instead? It makes the whole session business so
    much easier....

    --
    There is no signature.....

    Comment

    Working...