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

php or sql?
Sorry not sure if this is a sql problem or php the following code is supposed to delete data from th

Giving the below syntax error
Dear Experts,

I have used 2 buttons in gui status as display and cjhange.When the user wi

Recognising Revenue daily
Hello.
Has anyone come across daily recognition of deferred income?
We want to implement R

FPDF Help
I've been playing with the FPDF module. I was building a form and rolling right along and then sudde

please help
HTML Code:

Code: <span id="ctl00"><span>

Character increment
Hi,

I am facing a scenario like above,but in my case i want to show up like Col A,Col B etc..

Material Issuing for receiving batch
Dear All experts in MM/ PP,

Material issuing from main stores to factory is currently usi

shoping cart issues
i´ve wrote this and works when i add an item to, my cart, but when i want to add othrer item just

How to extract/download content from HTTPS page?
Hello to all the Members of this forum, Im Shoiab, A novice programmer in php.. for my first job I h

Calander Basic Spript help
hi, just starting out with PHP and have the following script:

<?php
//This gets t

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