RE: session_cache_limiter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 	i am getting a login name to print now on the new account
> page but i get the following error message:
> Warning: Cannot send session cache limiter - headers already sent
> (output started at /users/infoserv/web/register/ca/new_account.php:6)
> in /users/infoserv/web/register/ca/new_account.php on line 76
> logname=tad@optixcom.com
> 
> my code is as follows:
> <?
>    session_start();
>    if (@$auth != "yes")
> {
>       header("Location: login.php");
>       exit();
>    }
>    include("config.php");
> echo "logname=$logname<br>";
>    $sql = "SELECT first_name,last_name FROM accounts
>                   WHERE email='$logname'";
>    $result = mysql_query($sql)
>                 or die("Couldn't execute query 1.");
>    $row = mysql_fetch_array($result,MYSQL_ASSOC);
>    extract($row);
>    echo "
>          <head><title>New Account Welcome</title></head>
>          <h2 align='center' style='margin-top: .7in'>
>          Welcome $first_name $last_name</h2>\n";
> ?>
> 
> 
> without the below:
> 
> session_start();
>    if (@$auth != "yes")
> {
>       header("Location: login.php");
>       exit();
>    }
> 
> i can not get the new account name to print from the form just
submitted.
> 
> any ideas are greatly appreciated and thank you again. Addison

You must have session_start() before _any_ output to the browser. A
blank space or the <html> or any other tag is considered output. So, to
use sessions, the very first two characters of you file should be <? And
you should have a session_start() somewhere in that PHP block. 

If you'd do a little research or even read the error message, it's not
that hard to figure out. You are sending output starting on line 6 of
your file, but you have session_start() on line 76.

Hope that helps. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux