www.webdeveloper.com
Results 1 to 2 of 2

Thread: SESSION_START() Problems...

  1. #1
    Join Date
    Jan 2004
    Location
    Kokomo, IN
    Posts
    13

    SESSION_START() Problems...

    I am beginning to learn how to authenticate via MySQL and every time I try to use session_start(), then following stuff appears:
    Code:
    Warning: Cannot send session cookie - headers already sent by (output started at /home/httpd/
    html/testdir/verify.php:7) in /home/httpd/html/testdir/verify.php on line 31
    
    Warning: Cannot send session cache limiter - headers already sent (output started at /home/httpd/
    html/testdir/verify.php:7) in /home/httpd/html/testdir/verify.php on line 31
    Thanks!
    You're now logged in as kalataw

    Also, here's my code that i'm using when the actual login verification is done:
    PHP Code:
        else{
            
    $PHP_AUTH_USER $username;
            
    $PHP_AUTH_PW $password;
            
    session_start();
            
    session_register("PHP_AUTH_USER");
            
    session_register("PHP_AUTH_PW");
            echo 
    "Thanks!<BR>\n";
            echo 
    "You're now logged in as "$_SESSION['PHP_AUTH_USER']. "<BR>\n";
            echo 
    "<A HREF=logout.php>Click here</A> to logout.";
            
    session_destroy();
        }        


    What am I to do???
    -Wes

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,119
    post your php code at the very top of your page no html before the php part..that usually is the typical solution,unless you are sending an out put from some other php file which is imported in this file,
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles