garry27 Posted June 22, 2008 Share Posted June 22, 2008 I've recently migrated a site to a new server and the header function I use for login authentication has stopped working. I've tried using relative and absolute urls but in both cases the php appears to ignore the header function completeley. Any ideas please? Quote Link to comment Share on other sites More sharing options...
abdfahim Posted June 22, 2008 Share Posted June 22, 2008 can you post some portion of your code. Otherwise, there are lots of possibilities. Quote Link to comment Share on other sites More sharing options...
garry27 Posted June 22, 2008 Author Share Posted June 22, 2008 This is how I'm using it now. The echo out is just to confirm that the header line is being skipped out. if ($row['accType'] == 'P') { $_SESSION['valid_pa_mbr'] = $email; header ("Location: pa_mbr.php"); echo("pa member logged in.."); } Quote Link to comment Share on other sites More sharing options...
DarkWater Posted June 22, 2008 Share Posted June 22, 2008 It echos that stuff out? Quote Link to comment Share on other sites More sharing options...
garry27 Posted June 22, 2008 Author Share Posted June 22, 2008 correct ??? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted June 22, 2008 Share Posted June 22, 2008 Do you have display_errors on to show you if you have a "headers already sent out" error? Quote Link to comment Share on other sites More sharing options...
garry27 Posted June 22, 2008 Author Share Posted June 22, 2008 I've set errorreporting on and I hget the header already used error now. I guess I'm goint to have to rework it the way akitchen suggests in the sticky. Many thanks! Quote Link to comment Share on other sites More sharing options...
garry27 Posted June 22, 2008 Author Share Posted June 22, 2008 I'm confused now. I've moved the call to my login function from inside the html to above the html so that there's nothing getting outputted to the screen before the header function is called and I'm still getting the header error. Warning: Cannot modify header information - headers already sent by (output started at .../php_fns_scripts/auth_user_fns.php:102) in line 102 is the last line in that script (i.e. the php closing tag). login() is contained in that script witht he redirect code. My index page looks like this: <?php session_start(); require_once('all_php_fns.php'); error_reporting(E_ALL); login(); do_html_header('HomePage','','','',''); show_top_navbar(); show_main_div(); show_left_coln_inx(); show_right_coln_inx(); //contains login form do_html_footer(); ?> Quote Link to comment Share on other sites More sharing options...
peranha Posted June 22, 2008 Share Posted June 22, 2008 What is this file auth_user_fns.php is it outputing anything?? check line 102 of that file and see if there is something there. 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.