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

Only add new information from XML to MySQL
What I am doing, is taking a xml file, and adding the values to a database. However, what I want to

PHP hyperlinks generator
Hi

I need some help to get this done using php:


1 - I have few hyperlinks say 500

Save file by click
Hello.
I'm not understand how to save file from page. I'd like make link to file with save abil

Rss feed question
Hi

My blog and my website are different. Am i able to take my rss feed
from my blog and p

What makes a script your own?
If someone finds a login script online, and changes some variable names around and some other minor

getAlexaRank($url) function not working
I have made a function to get alexa rank
the site is here: http://mytestsite.rack111.com/1

frame help
on the bottom frame is menu.html

Code: <body><form action='link.php' met

Querying info from one table based on info in another
Hi, I am currently trying to make a part for my user driven website where one user can subscribe to

Insert data in Mysql and move to another page
I'm stuck with this simple problem. I need to insert data in Mysql and then hit submit and move to a

have trouble in a if condition
The if below is working ok, it check when indexes, name, zipcode and state are empty.
Code: &

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