Jump to content

[SOLVED] help, header() is not working!


samoi

Recommended Posts

Hello, I have this code:

 

<?php

/**
* @author samoi
* @copyright 2009
*/

error_reporting(E_ALL & E_NOTICE);

include ('func.php'); // this has the session_start() func!

if (isset($_SESSION["uid"])) {


    $_SESSION["uid"]+= 1;

} else {

    header('location: login.php'); // it's not redirecting! it gives a white page only!
    die(); // I run this die() and error_reporting() to debug, but no chance!
}

echo $_SESSION["uid"];
echo '<br />';
echo '<a href="logout.php"> LogOut </a>';
?>

 

 

it works if it's in ongoing session!

but fails if no session in there, it does not work "header()" !

 

 

Thank you in advance!

Link to comment
https://forums.phpfreaks.com/topic/177506-solved-help-header-is-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.