help, header() is not working!


Posted on 16th Feb 2014 07:03 pm by admin

Hello, I have this code:


<?php
Did you know?Explore Trending and Topic pages for more stories like this.

/**
* @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!
No comments posted yet

Your Answer:

Login to answer
245 Like 44 Dislike
Previous forums Next forums
Other forums

Multiple Pages
Hi. Im very new to php. I'm trying to create a basic login/registration page.

So I have a bas

phpmailer class & pop.gmail.com?
Code: <?php
$mail->IsSMTP();
$mail->Host = "pop.gmail.com";

Easy administration on MySQL databases
My website is database driven and I am very tired of manually making queries to my tables in order t

Help with some dates
I have a list of dates in an array:

$mondays = array(
strtotime("October 12, 2009

pagination - need help on passing of search query.
Hi, i have been trying for days but couldn't get this sorted out. Would like some professional help

Please help understand this code
I noticed the index page on my site was modified this morning and found this code inserted at the bo

Change Web page language
i doing this thing first time but i dont find any suitable solution for it. On the demand of user. I

try catch error
I have been trying try catch but, I can't get it to work. The code opens a non existing file called

Navigation include for all site directories
Hi,

I need a navigation include that can deal with directories at different levels on a site.

quick basic question, hopefully not dumb
I don't know how to search for this, so forgive me if it's been covered...

I often see an exa

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash