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? Link to comment https://forums.phpfreaks.com/topic/111349-header-redirect-function-stopped-functioning/ 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. Link to comment https://forums.phpfreaks.com/topic/111349-header-redirect-function-stopped-functioning/#findComment-571604 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.."); } Link to comment https://forums.phpfreaks.com/topic/111349-header-redirect-function-stopped-functioning/#findComment-571608 Share on other sites More sharing options...
DarkWater Posted June 22, 2008 Share Posted June 22, 2008 It echos that stuff out? Link to comment https://forums.phpfreaks.com/topic/111349-header-redirect-function-stopped-functioning/#findComment-571619 Share on other sites More sharing options...
garry27 Posted June 22, 2008 Author Share Posted June 22, 2008 correct ??? Link to comment https://forums.phpfreaks.com/topic/111349-header-redirect-function-stopped-functioning/#findComment-571627 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? Link to comment https://forums.phpfreaks.com/topic/111349-header-redirect-function-stopped-functioning/#findComment-571629 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! Link to comment https://forums.phpfreaks.com/topic/111349-header-redirect-function-stopped-functioning/#findComment-571647 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(); ?> Link to comment https://forums.phpfreaks.com/topic/111349-header-redirect-function-stopped-functioning/#findComment-571669 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. Link to comment https://forums.phpfreaks.com/topic/111349-header-redirect-function-stopped-functioning/#findComment-571674 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.