Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 3rd, 2006, 12:34 PM
ire ire is offline
Authorized User
 
Join Date: May 2006
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

 
Old July 3rd, 2006, 12:42 PM
Friend of Wrox
 
Join Date: Nov 2005
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
 
Old July 3rd, 2006, 01:35 PM
ire ire is offline
Authorized User
 
Join Date: May 2006
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?

 
Old July 3rd, 2006, 01:48 PM
Friend of Wrox
 
Join Date: Nov 2005
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
 
Old July 4th, 2006, 08:50 AM
Registered User
 
Join Date: Jun 2006
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?






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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.