Re: First time caller, long time listener...

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

 



> I am very new to the world of PHP, and still trying to get my foot in the
> door. Not doing too bad so far, good fun it all is... but i am having a
> problem working out what exactly the problem is here with sessions.
>
> Here is the code for page one of the tutorial, i copied it straight from
> codewalkers.com in the 'sessions' tutorial...
>
> <HTML>
> <BODY>
> <?
> //Page 1 using sessions!!!
> session_start();
> $_SESSION["real_name"] = "Hartleigh Burton";
> print "<A href='page2.php'>Go to this page.</A>";
> ?>
> </BODY>
> </HTML>
>
> ...and here are the errors that i receive in my browser when loading...
>
> Warning: Cannot send session cookie - headers already sent by (output
> started at E:\Webroot\tutorial\page1.php:3) in
> E:\Webroot\tutorial\page1.php on line 5

session_start() must be at the beginning of your code, before any output or
HTML.

<?
session_start();
?>
<html>
...

> Warning: Cannot send session cache limiter - headers already sent (output
> started at E:\Webroot\tutorial\page1.php:3) in
> E:\Webroot\tutorial\page1.php on line 5
>
> Warning: open(/tmp\sess_97999e1abf7d49da95469a65786cd945, O_RDWR) failed:
> No such file or directory (2) in E:\Webroot\tutorial\page1.php on line 5

There is a setting in php.ini that tells PHP where to write it's session
files to. Right now it's set to /tmp. You need to change that to a valid
path for your machine and make sure your web server can write to that
directory.

Hope that helps, have fun!

---John Holmes...


-- 
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