Loathorhealer Posted March 22, 2006 Share Posted March 22, 2006 Okay. so I have these files.Header.php and Welcome.php <--the header .php file contains.[code]<?phprequire_once 'databaseinfofile.php';?><html><head><title> Torque - Your Sports Cars Headquarters</title></head><link rel="stylesheet" href="tor.css"><table cellpadding="0" cellspacing="0" width="1000" align="center"><?php print("<tr><td align=\"center\">"); print("<img src=\"images\banner.jpg\" align=\"center\" style=\"border:1px solid #868686\">"); print ("</td></tr>"); print("<tr><td class=\"thead\" width=\"1000\" height=\"29\" style=\"border-bottom:1px solid #868686\" style=\"border-right:1px solid #868686\" style=\"border-left: 1px solid #868686\">"); print("<table align=\"right\" width=\"1000\" height=\"29\" cellpadding=\"0\" cellspacing=\"1\"><tr>"); print("<td width=\"700\">");if ($logged_in == 1) { print("<a href=\"welcome.php?page=user_profile\"><img src=\"images\usercp.jpg\" border=\"0\"></a> <img src=\"images\memberlist.jpg\">");} else { echo 'Register';} print("</td><td class=\"contenthead\" width=\"300\" align=\"right\">");if ($logged_in == 1) { echo 'Logged in as '.$_SESSION['username'].', <a href="logout.php">logout</a>';} else { echo 'Not logged in. <a href="login.php">Login</a>';} print ("</td></tr></table>");?></table>[/code]and then. The Welcome has[code]<?phprequire_once 'header.php'; print ("</td></tr></table>"); if ($logged_in == 1) { echo 'welcome back '.$_SESSION['username'].'';} else { print ("<h1>Login</h1><form action=\"login_functions.php\" method=\"post\"><table align=\"center\" border=\"1\" cellspacing=\"0\" cellpadding=\"3\"><tr><td>Username:</td><td><input type=\"text\" name=\"uname\" maxlength=\"40\"></td></tr><tr><td>Password:</td><td><input type=\"password\" name=\"passwd\" maxlength=\"50\"></td></tr><tr><td colspan=\"2\" align=\"right\"><input type=\"submit\" name=\"submit\" value=\"Login\"></td></tr></table></form></body></html>");}?>[/code]okay. and then at the top of my page..I get these errors:[code]Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/.navy/loathor/squaresyndicate.com/welcome.php:2) in /home/.navy/loathor/squaresyndicate.com/check_login.php on line 5[/code]and what It does, is it registers the session on another page called Login_functions <-- and I dont understand why Im getting that error. :-/ Link to comment https://forums.phpfreaks.com/topic/5468-need-some-help/ Share on other sites More sharing options...
hitman6003 Posted March 22, 2006 Share Posted March 22, 2006 The easiest thing to do is to make session_start() the first command intrepreted by php. If anything has been sent to the browser before session_start() has been called, it will fail.Move session_start() to the top...make it the first include and at the top of that include, then it should work. Link to comment https://forums.phpfreaks.com/topic/5468-need-some-help/#findComment-19548 Share on other sites More sharing options...
Loathorhealer Posted March 22, 2006 Author Share Posted March 22, 2006 [!--quoteo(post=357181:date=Mar 21 2006, 09:24 PM:name=hitman6003)--][div class=\'quotetop\']QUOTE(hitman6003 @ Mar 21 2006, 09:24 PM) [snapback]357181[/snapback][/div][div class=\'quotemain\'][!--quotec--]The easiest thing to do is to make session_start() the first command intrepreted by php. If anything has been sent to the browser before session_start() has been called, it will fail.Move session_start() to the top...make it the first include and at the top of that include, then it should work.[/quote]LOL you can call me retarted. I had a space in my welcome.php <-- first line and thats what screwed it up. Thanks a bunch. But before I go. I was wondering if you could help me really quick. I want a profile page. somewhat close to Myspace. I was wondering if you could maybe point me in the right direction?I can write how the person can view it. BUT I need scripts to how it updates the database. Im not entirely sure how I can do that. Link to comment https://forums.phpfreaks.com/topic/5468-need-some-help/#findComment-19553 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.