jayvenom Posted April 6, 2009 Share Posted April 6, 2009 hey i have created a page which is used to insert records into mySql.. records get inserted perfectedly.... but after insertion its not loading into another page...that is the inserted record must be reviewd.. NOTE:this works perfectly in WAMP5 server... but not in my host... also header() works for other files except this.... Link to comment https://forums.phpfreaks.com/topic/152782-header-not-working-properly/ Share on other sites More sharing options...
Mchl Posted April 6, 2009 Share Posted April 6, 2009 Does script do any output before calling header()? WampServer has output_buffering enabled by default, which hides such errors, but they come out when the code is run on server with ob disabled. Link to comment https://forums.phpfreaks.com/topic/152782-header-not-working-properly/#findComment-802294 Share on other sites More sharing options...
WolfRage Posted April 6, 2009 Share Posted April 6, 2009 Most likely you are outputting some information and thus headers is failing. You can comb through your code to find the problem or you can use a <meta> redirect. Link to comment https://forums.phpfreaks.com/topic/152782-header-not-working-properly/#findComment-802296 Share on other sites More sharing options...
jayvenom Posted April 6, 2009 Author Share Posted April 6, 2009 how to do the <meta> redirect? Link to comment https://forums.phpfreaks.com/topic/152782-header-not-working-properly/#findComment-802319 Share on other sites More sharing options...
WolfRage Posted April 6, 2009 Share Posted April 6, 2009 <?php echo '<meta http-equiv="refresh" content=".01; url=http://127.0.0.1:/" />'; ?> Link to comment https://forums.phpfreaks.com/topic/152782-header-not-working-properly/#findComment-802324 Share on other sites More sharing options...
PFMaBiSmAd Posted April 6, 2009 Share Posted April 6, 2009 Using a <meta> redirect when you are outputting something on a page will waste your hosting account bandwidth. You need to find the reason why your code stopped working and fix it, especially since there is only a problem on one page. Link to comment https://forums.phpfreaks.com/topic/152782-header-not-working-properly/#findComment-802325 Share on other sites More sharing options...
jayvenom Posted April 6, 2009 Author Share Posted April 6, 2009 actually i used Dreamweaver for that... am new to this php... $insertGoTo = "viewinad.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); Link to comment https://forums.phpfreaks.com/topic/152782-header-not-working-properly/#findComment-802331 Share on other sites More sharing options...
jayvenom Posted April 6, 2009 Author Share Posted April 6, 2009 thankx bro the meta tag works... but takes time.. not like the header.... but as am intrested in learning this php... i would like to know why its not working!!!! Link to comment https://forums.phpfreaks.com/topic/152782-header-not-working-properly/#findComment-802337 Share on other sites More sharing options...
revraz Posted April 6, 2009 Share Posted April 6, 2009 As stated before, probably because you have browser output before your header. Turn on error display and reporting and see if you get a header error. Link to comment https://forums.phpfreaks.com/topic/152782-header-not-working-properly/#findComment-802340 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.