LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-20-2002, 09:00 AM   #1
niehls
Member
 
Registered: Jun 2002
Location: Sweden
Distribution: slack, redhat
Posts: 91

Rep: Reputation: 15
php session problem


i trying to set a session variable, but all i get is this error message.

code:
<?
session_register("name");
?>

message:

Warning: Cannot send session cookie - headers already sent by (output started at c:\usr\htdocs\bejken\homepage\runkirunki.php:7) in c:\usr\htdocs\bejken\homepage\runkirunki.php on line 8

Warning: Cannot send session cache limiter - headers already sent (output started at c:\usr\htdocs\bejken\homepage\runkirunki.php:7) in c:\usr\htdocs\bejken\homepage\runkirunki.php on line 8

what to do?
 
Old 06-20-2002, 09:59 AM   #2
dorward
Member
 
Registered: Sep 2001
Distribution: Gentoo
Posts: 760

Rep: Reputation: 31
Set the cookie as the VERY FIRST thing you do in the file. The first characters of the php file should be <?php (nothing before them, not even new lines or spaces) and you should use no code that outputs to the browser before you set the cookie.
 
Old 06-20-2002, 11:30 AM   #3
niehls
Member
 
Registered: Jun 2002
Location: Sweden
Distribution: slack, redhat
Posts: 91

Original Poster
Rep: Reputation: 15
i don't..this is the whole code..(simple):

<html>
<head>
<title>
</title>
</head>
<body>
<?
session_register("name");
?>
</body>
</html>
 
Old 06-20-2002, 11:51 AM   #4
niehls
Member
 
Registered: Jun 2002
Location: Sweden
Distribution: slack, redhat
Posts: 91

Original Poster
Rep: Reputation: 15
ahh......stupid me..hehe
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Are PHP session variables held in memory when you leave a PHP site? Locura Programming 11 11-16-2008 08:37 PM
php session richard22 Programming 2 10-26-2004 05:50 AM
PHP Session problem!!! AskMe Programming 9 06-03-2004 07:33 AM
RH9: PHP session problem (or Apache problem) fengcn Red Hat 0 12-01-2003 06:32 PM
php session problem with windoze antken Linux - General 6 08-16-2002 08:28 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration