iarp Posted April 26, 2008 Share Posted April 26, 2008 Hey, The other day i transfered a website to my laptop that runs mysql5 and newest php, and it was giving me a ton of errors because my web host uses mysql4 and php 4.4.8. My laptop is giving me an error saying session_start is being ignored in my header file because it was called already in the main page. Which is a better location for session_start() ? in the header.php which is include(''); into each page, or call session_start at the very beginning before the header or anything else. Quote Link to comment https://forums.phpfreaks.com/topic/103076-solved-session_start-twice/ Share on other sites More sharing options...
pocobueno1388 Posted April 26, 2008 Share Posted April 26, 2008 Put it where it will be at the very top every time. So if you call your header.php file at the top of every page, then put it at the top of the header file. Quote Link to comment https://forums.phpfreaks.com/topic/103076-solved-session_start-twice/#findComment-527972 Share on other sites More sharing options...
PFMaBiSmAd Posted April 26, 2008 Share Posted April 26, 2008 Also, the warnings and notices you are seeing now were always present in your code, but the display_errors and/or error_reporting settings were preventing you from seeing them. This is not a php4 vs php5 problem, but code that is doing things incorrectly and was developed in an environment that hid the problems. Quote Link to comment https://forums.phpfreaks.com/topic/103076-solved-session_start-twice/#findComment-527985 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.