help, header() is not working!


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

Hello, I have this code:


<?php
Did you know?Explore Trending and Topic pages for more stories like this.

/**
* @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/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Search function
I am looking for some guidance from the experts.

I am trying to create a search function. It

Include ("Absolute Path") of a file?
I'm not sure what I'm doing wrong. I am writing my php code in the same directory of the file that

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

Problem with "dynamic" index page
Hi. I have one question. In my index.php page I have this kind of code:
Code: // listaa sivut

Problem with PHP code- simple contact form
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a contact form wit

phph within href not showing php if change ? to &
Code: [Select]<a href="<?php echo $puser; ?>?m=<?php=(($m-1)&l

Calculating a rating by adding number of points and dividing by number of items
I have a site that users can post links to files to download. They can rate these files on a 1-5 sca

for some reason mysql query not working, not inserting, please check it out
This code is not inserting anything into my db, don't know why, the $_SESSION variable does contain

Taking an HTML form and a PHP program and making it into one working file.
Hello,

So I would like to display everything INSIDE a specific directory. In other words, I

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