Jump to content

header redirect function stopped functioning


garry27

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.