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!

245 Like 44 Dislike
Previous php-forum Next php-forum
Other php-forum

IS this code correct
The reason i ask is everything underneath it appears to be alink as well, tis blimmin annoying

Help with setcookie()
Merry Xmas to those on this foruum
Older guy here with some experience but not allot so please be

remove trailing slash from array
I have the following array which contains trailing slashes I need to remove. What is the best way to

Seperate team from score
I am writing a site that does a NFL Pick 'em type application and I have a feed that gives me the sc

Login script (probably a simple error)
dbConfig.php
Code: <?
// Replace the variable values below
// with your specific dat

getting weird error..
okay, I'm getting an error on this particular function, something about the syntax in the mysql LIMI

session variable problem
Session variable is not working in Fire fox i am getting null value but it is working fine in IE.

Uploading Filetypes and placing them in seperate folders.
Hello,

first post , and asking for help im afraid. Very new to PHP, was making good progress

Select Lists into MYSQL
Hello All, I am new to PHP @ 1 week. So borrowing code anywhere I can. I am making progress, but h

error help - Dynamic Image
I've been working on making my site less cluttered in the directories and more secure lately. In an

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