Hi, guys!
I'm having a few difficulties with sessions.
I had a login/registration system before but it used separate pages (like index.php, login.php, adminlist.php), but now I wish to put it into one and make it operate based on "area", such as index.php, index.php?area=login, index.php?area=adminlist.
So I tried setting up the sessions stuff.
But I get 2 errors that I've never faced before:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\panel\index.php:1) in C:\xampp\htdocs\panel\index.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\panel\index.php:1) in C:\xampp\htdocs\panel\index.php on line 2
I read about it from Google and yes session_start() is the first line of the script, starting like this:
<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
...
...
I have no idea what's wrong.
In my code I use the following statements:
if(session_is_registered("myusername"))
session_register("myusername");
The script is 275 lines and I'm sure I've done something VERY WRONG (about the sessions).
http://pastebin.com/fd0c95a9
I would be SOOO thankful if you'd help me!