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 Link to comment https://forums.phpfreaks.com/topic/101560-cannot-modify-header-information-headers-already-sent/ 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. Link to comment https://forums.phpfreaks.com/topic/101560-cannot-modify-header-information-headers-already-sent/#findComment-519458 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. Link to comment https://forums.phpfreaks.com/topic/101560-cannot-modify-header-information-headers-already-sent/#findComment-519469 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 Link to comment https://forums.phpfreaks.com/topic/101560-cannot-modify-header-information-headers-already-sent/#findComment-519472 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? Link to comment https://forums.phpfreaks.com/topic/101560-cannot-modify-header-information-headers-already-sent/#findComment-519477 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 Link to comment https://forums.phpfreaks.com/topic/101560-cannot-modify-header-information-headers-already-sent/#findComment-519479 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? Link to comment https://forums.phpfreaks.com/topic/101560-cannot-modify-header-information-headers-already-sent/#findComment-519571 Share on other sites More sharing options...
conker87 Posted April 17, 2008 Share Posted April 17, 2008 Oh and IMO means In my opinion Link to comment https://forums.phpfreaks.com/topic/101560-cannot-modify-header-information-headers-already-sent/#findComment-519574 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. Link to comment https://forums.phpfreaks.com/topic/101560-cannot-modify-header-information-headers-already-sent/#findComment-519577 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.