help, header() is not working!


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

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!

No comments posted yet

Your Answer:

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

Display thumbnails as square while retaining aspect ratio
I am trying to figure out a way to make an image display as a square, for example 80x80 pixels, when

Form always sends to error page...
Hello,
Any help will be greatly appreciated. I am having trouble getting multiple fields to be re

Displaying Site Logo/Icon on a Title tag
really need some help out here. I want to insert a Logo/Icon just like the one close to the "PH

Somebody hacked into my site and changed coding >>> URGENT HELP NEEDED <<<
I am not that much into programming , but somebody is hacking to my site and injecting some kind of

Multiple forms on the same page (safari)
Hello everyone,

I have 3 forms on the same page, that opens in a new window and submits to a

my code does not work.
I have a code problem.

Quote"<a href=index.php?gogo=ureticidetay&'?l={$le

Javascript form submit and radio buttons?
When this form is submitted, it is automatically resubmitted using JS.

All my fields are carr

Calculus Help (and by help I mean homework)
Hrmmm, I hate posting about math homework, partly because it's homework, and partly because I hate w

http to https
Hi,

Is there any specific method/condition to move an http:// page to https:// ?

How to change Time Zone
HI
I want to change the time zone of the server to another country.How can do that?

Thanks

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