sioleabha Posted January 17, 2009 Share Posted January 17, 2009 Yes, I just read the sticky regarding header() errors, and I double-triple checked that there is no whitespace or ANYTHING being sent to the browser before the header. I have three scripts on my website that all use header: a login script and two dynamically generated images. Two weeks ago they all worked, and I have not done *anything* to my website since then except to post one blog entry. My husband upgraded our server through Plesk, but I checked and PHP has not been upgraded. (We are using 5.1.6) I am not sure if any changes were made to PHP, though. Yesterday I got an email from my best friend letting me know that she cannot login to comment on my blog, and while troubleshooting I determined that header() is the problem. I cannot even write a simple redirect that does NOTHING but use header(), such as: <?php header("Location: http://www.usr-bin-mom.com/"); exit; ?> I copied that directly from php.net, but it does not work. No matter how I try to use header(), it fails. I am not getting any error message, because at some point my husband changed something that means I never get error messages anymore, and he doesn't remember what he changed. Help? Link to comment https://forums.phpfreaks.com/topic/141218-solved-header-suddenly-stopped-working-in-every-script/ Share on other sites More sharing options...
PFMaBiSmAd Posted January 17, 2009 Share Posted January 17, 2009 Add the following two lines of code immediately after your <?php tag - ini_set ("display_errors", "1"); error_reporting(E_ALL); Link to comment https://forums.phpfreaks.com/topic/141218-solved-header-suddenly-stopped-working-in-every-script/#findComment-739132 Share on other sites More sharing options...
sioleabha Posted January 17, 2009 Author Share Posted January 17, 2009 Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/usr-bin-mom.com/httpdocs/refer/refer.php:182) in /var/www/vhosts/usr-bin-mom.com/httpdocs/set_cookie.php on line 4 Link to comment https://forums.phpfreaks.com/topic/141218-solved-header-suddenly-stopped-working-in-every-script/#findComment-739147 Share on other sites More sharing options...
sioleabha Posted January 17, 2009 Author Share Posted January 17, 2009 I fixed it -- thank you! Somehow my referrer script was screwing it up. I'm not sure why -- I haven't touched that referrer script or anything to do with it in ages. Since I don't really care about it anymore, I just removed it, and now everything works! Thanks for showing me how to get the error to display! Link to comment https://forums.phpfreaks.com/topic/141218-solved-header-suddenly-stopped-working-in-every-script/#findComment-739150 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.