soumadri Posted April 17, 2008 Share Posted April 17, 2008 i have two files 1. access_user_class.php - for login management 2. login.php - for login GUI (which includes my gui template from another file) The include sequence in login.php is 1> access_user_class.php 2> template1_wobar.php eg. include("$_SERVER[DOCUMENT_ROOT]/includes/stripgpcslash.inc.php"); include("$_SERVER[DOCUMENT_ROOT]/classes/access_user/access_user_class.php"); include("$_SERVER[DOCUMENT_ROOT]/includes/validate_email.inc.php"); include("$_SERVER[DOCUMENT_ROOT]/includes/injection_attack.inc.php"); include("$_SERVER[DOCUMENT_ROOT]/includes/cleanvar.inc.php"); include("$_SERVER[DOCUMENT_ROOT]/template1_wobar.php"); now when login is successful i call a function from access_user_class.php, which inturn sets the http header location: to my home page. e.g. if ($goto_page) { header("Location: ".$next_page); exit; } here i am getting the following warning, bcoz of which my home page is not rendering Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\template1_wobar.php: in C:\wamp\www\classes\access_user\access_user_class.php on line 111 Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted April 17, 2008 Share Posted April 17, 2008 ob_start() & ob_end_flush(); will help short term - better (IMO) to code with the need for them though. Quote Link to comment Share on other sites More sharing options...
soumadri Posted April 17, 2008 Author Share Posted April 17, 2008 hey thnx for ur help. can u plz elaborate wht ob_start() is? what is IMO? and where and how to put this piece of code. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted April 17, 2008 Share Posted April 17, 2008 http://uk.php.net/manual/en/function.ob-start.php Quote Link to comment Share on other sites More sharing options...
soumadri Posted April 17, 2008 Author Share Posted April 17, 2008 i am still getting the same error. can u plz suggest some other method? Quote Link to comment Share on other sites More sharing options...
miracle_potential Posted April 17, 2008 Share Posted April 17, 2008 This error means your outputting before your header has been set. Set your header before you output and use the ob_flush function ToonMariner said to use. Should be dandy after that Quote Link to comment Share on other sites More sharing options...
discomatt Posted April 17, 2008 Share Posted April 17, 2008 Did you even read the forum rules, posting guidelines... or ANY stickies for that matter? Quote Link to comment Share on other sites More sharing options...
conker87 Posted April 17, 2008 Share Posted April 17, 2008 Oh and IMO means In my opinion Quote Link to comment Share on other sites More sharing options...
haku Posted April 17, 2008 Share Posted April 17, 2008 There is a topic with this exact same title every week or so. A quick search would have found probably 50 threads or more exactly like it. 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.