ColinHarbut Posted March 7, 2007 Share Posted March 7, 2007 I am wrapping php scripts around another .php file like this: http://www.calpropertysearch.com/buy.php And its working just fine except on the "login.php" where I get an error when I throw it into another php document. The file with the error can be seen here: http://calpropertysearch.com/login2.php Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /usr/www/users/charbut/calpropertysearch/login2.php:7) in /usr/www/users/charbut/calpropertysearch/login-script.php on line 2 Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/charbut/calpropertysearch/login2.php:7) in /usr/www/users/charbut/calpropertysearch/login-script.php on line 59 I was really hoping to keep the login.php file inside of my template with the links across the top. Right now it is here without the template: http://www.calpropertysearch.com/login.php If I remove the session_start(); in the login-script.php document when trying to use the template, the error goes away, it appears in the template just fine, but I can't login! Any suggestions? Quote Link to comment Share on other sites More sharing options...
spfoonnewb Posted March 7, 2007 Share Posted March 7, 2007 Make sure you read the stickies... <?php ob_start(); ?> http://ca.php.net/manual/en/ref.outcontrol.php Quote Link to comment Share on other sites More sharing options...
craygo Posted March 7, 2007 Share Posted March 7, 2007 please post the code for your pages Quote Link to comment Share on other sites More sharing options...
ColinHarbut Posted March 7, 2007 Author Share Posted March 7, 2007 <?php session_start(); require_once('Connections/myconn.php'); ?> this is my login-script.php, where if I remove the session_start(); the error doesnt occur but I can't login. I'm not sure what to replace with that code with to prevent that error message from showing. Read what stickies? This code doesn't work: <?php ob_start(); ?> If you need more of my login-script.php code please let me know... Thank you Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted March 7, 2007 Share Posted March 7, 2007 Sometimes session start can be very picky, even with text below it. Try putting it in it's own code island, at the VERY, VERY top of the page. <?php session_start(); ?> <?php // whatever else here. ?> Quote Link to comment Share on other sites More sharing options...
ColinHarbut Posted March 7, 2007 Author Share Posted March 7, 2007 What should I do with : require_once('Connections/myconn.php'); Sorry I know nothing about PHP Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted March 7, 2007 Share Posted March 7, 2007 No, ob start straight away doesn't work, if your code is down in a page, what I showed you won't help. As far as ob flush, just calling that one function won't do anything. http://us2.php.net/flush ready that through, and some of the user comments. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.