Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 3rd, 2006, 12:34 PM
ire ire is offline
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Session error message

Hi,
I need to place a header.php file within a table cell in another body.php file. The header file has a session.start() code block in it while the body.php file requires the header.php file. When I run the app, I encounter the message: "Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at ...."
It works fine if I place the require code at the very top - but it contravenes my design. The web app is all enclosed in a table. How can I place the code within a table cell and still have the same results?

Please assist, thanks

Reply With Quote
  #2 (permalink)  
Old July 3rd, 2006, 12:42 PM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I think the problem is as it says. You are probably using the function session_start() twice
place the function session_start()in body.php or header.php not both.
A beter solution would be to but the session start in a different file.

BTW your table layout is not the issue in your problem.

__________________________________________________ ________
This is my junk I'm gona eat it
Reply With Quote
  #3 (permalink)  
Old July 3rd, 2006, 01:35 PM
ire ire is offline
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks DJ Kat, I appreciate that prompt response. I have doubled checked and I may confirm that only one file- the header.php file has the session_start() method and not the body.php. The body.php only requires the header.php. are you suggesting that I should take out the requires code from the body.php file?

Reply With Quote
  #4 (permalink)  
Old July 3rd, 2006, 01:48 PM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It seems you and a other member have the same problem,

I think I got the awser to your problem. You are probably testing on your localhost.
Is it by any chance that you PHP directory is located c:\Program Files or c:\Windows

You need to set the permissions on the folder PHP.
Use windows explorer en select properties of this folder and change the permisions.

This has been discussed on this forum before check it out

http://p2p.wrox.com/topic.asp?TOPIC_ID=8169.


__________________________________________________ ________
This is my junk I'm gona eat it
Reply With Quote
  #5 (permalink)  
Old July 4th, 2006, 08:50 AM
Registered User
 
Join Date: Jun 2006
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Sean1989
Default

I too have session start elsewhere but im a newbie at php and the way it is layed out i dnt think i could remove it in some places. But if i remove it on the page where the login name will be displayed, the message does disapear but it then doesnt show as anyone is logged in.

Any ideas?

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the error message for a 500 server error? chobo2 C# 2005 1 May 4th, 2008 03:11 AM
Help with an error message Shadows Beginning VB 6 1 August 27th, 2007 07:06 AM
Error message help iacon VB Databases Basics 2 June 20th, 2006 02:09 PM
Error Message with VS rahi Visual Basic 2005 Basics 0 March 11th, 2006 10:32 PM
session timeout message blueguy HTML Code Clinic 2 October 8th, 2004 12:01 AM



All times are GMT -4. The time now is 02:39 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.