Cannot create session.

Status
Not open for further replies.

tgskullkings

New Member
Messages
2
Reaction score
0
Points
0
Hi, I am creating a project for a somewhat youtube clone, but just to watch, login, logout, download, and see info. But when I try to create a session for a user, logged in or not, it gives me an error on the page saying, "Cannot create session(), headers already sent. I am including a file but I am not sure if that is the problem. Unfortunately it says this for both using a MySQL database for users and a flat file of users. Can anyone help me with my problem?
 

Christopher

Retired
Messages
14,659
Reaction score
8
Points
0
You need to create a session before you send stuff to the user or use ob_cache.
 

tgskullkings

New Member
Messages
2
Reaction score
0
Points
0
So lets say I'm using an include in my php script that writes through a series of functions. Do i have to put session_start() at the top of my main page or the include script. Bcus this is confusing me, my brain is about to explode. It doesn't even work on my comp, and I got PHP, CGI, MySQL and stuff on my computer to work off of. I don't know if you need the code to be able to make any further suggestions but I can offer the code to you, if you need it. It's just a little Youtube type Clone script that I'm adding onto for more features. Just to let ya know. And if you can further fill me on ob_cache and it's functions that would be great help in my project if needed.
 
Status
Not open for further replies.
Top