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

split values
I have values that are returned to me in this format:

name=>test,age=>49

Are sessions secure at all?..
I haven't really gotten into yet, but I was just thinking of something weird..

Lets say you h

Find current logon time
Hi,
in my sql script i want to query and find out the logon time of the current session.
<

Namespace Problem
I'm having problem with a section of code with a variable namespace.

This code works fine:

want a code for uploading and downloading
i m trying to upload and download to my site..i need upload and download code ...i use a code for up

Help with translating C code into assembler code
Hi im doing a project that moves a robot around a maze avoiding walls and need some help with conver

PHP Code reffering to database, doing something wrong.. pls help
Well i am quite new with PHP
and for school we have to make a PHP script which reffers to a Data

Beginners syntax and loop questions - help please!
Hi everyone,

I have some problems with php code. I'm currently in the middle of learning php,

Table sorting
Hi,

I'm trying to modify the following in order to make the output table sorted alphabeticall

Dynamically allocating the number of rows in a table based on a variable value
Hi,
I have situation here which i cannot resolve, I have a variable temp which stores the num

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