Problem with session_start() - [SOLVED]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

if you have a page included on another it inhertits the first pages values.
User avatar
harsha
Forum Contributor
Posts: 103
Joined: Thu Jul 11, 2002 1:35 am
Location: Bengaluru (Bangalore) > Karnataka > India

Post by harsha »

well the problem might be for the following reasons;

1. you have left a blank line after the the ?> (end PHP tag) at the end of the files which you have inlcude_once or require_once, what ever blah blah

2. Remember you have to avoid sending any html (this includes blank lines out side php) to apache before registering sessions and this dependes on how you design the project to be i mean the include, require tricks.

3. you have not used headers here so no need to worry


Now with these three things in Mind come out of the problem and think once you will find the solution for yourself ;-)

The same old problem I had faced long time before, I posted it here and we solved togather here in devnetwork, thank you all, I love devnetwork :D
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

Did i notice something you including the file that has the session_start in it ?
while the file including it has rather some lines of code before you including the session_start.
jmrdeuce32
Forum Newbie
Posts: 15
Joined: Wed Apr 27, 2005 5:45 pm
Location: Naples, FL

Resolved...

Post by jmrdeuce32 »

Hey everyone. Thanks for the help.

I think I finally figured it out and it doesn't seem to be a code problem. I recreated the file that was giving me the errors using notepad instead of Dreamweaver and it works fine. So it must have something to do with the hidden chars that Jcart mentioned.

Thanks Again!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

It always is ;)
Post Reply