note 47766 added to faq
| From: | manish_it56 at yahoo dot com | Date: | Mon, 29 Nov 2004 07:59:16 +0000 |
| Subject: | note 47766 added to faq | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81137@lists.php.net to get a copy of this message | ||
Hello Sir,
I m creating site using php and mysql.
Plz help me to set session variable and display on another page...
I tried this code...
session_start(); // This connects to the existing session
session_register ("name"); // Create a session variable called name
session_register ("job"); // Create a session variable called job
$HTTP_SESSION_VARS ["name"] = $name; // Set name = form variable $name
$HTTP_SESSION_VARS ["job"] = $job; // Set job = form variable $job
but it is giving error like this
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent
by (output started at c:\Inetpub\wwwroot\php\insert.php:4) in c:\Inetpub\wwwroot\php\insert.php on
line 11
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers
already sent (output started at c:\Inetpub\wwwroot\php\insert.php:4) in
c:\Inetpub\wwwroot\php\insert.php on line 11
Notice: Undefined variable: name in c:\Inetpub\wwwroot\php\insert.php on line 17
Notice: Undefined variable: job in c:\Inetpub\wwwroot\php\insert.php on line 19
Notice: A session had already been started - ignoring session_start() in
c:\Inetpub\wwwroot\php\insert.php on line 23
plz give me answer as soon as possible
----
Manual Page -- http://www.php.net/manual/en/faq.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47766
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47766&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47766&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47766&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47766&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47766&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47766&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47766&report=yes
Search -- http://master.php.net/manage/user-notes.php