Hey all… My first post here on this site… And also my first php project…
It’s a login system with Mysql… I can log in and stay logged in on my site - both on my test server and on my real server… But then I try to make a secure area with this kind of thing…
uid == 0 then go to page…
This works on my test server, but not my real server…
Hope one of you can help me… I post the code I have on all my pages and you can see the if uid == 0 thing that is not working IRL
[php]<?php
session_start();
require_once ‘models/user.class.php’;
$uid = 0;
if (isset($_SESSION[‘uid’])){
$uid = $_SESSION[‘uid’];
}
$user = new User($uid);
if($uid == 0){
header('Location:LogIn.php');
}
if (array_key_exists(‘login’, $_POST))
{
$user->login($_POST);
}
?>[/php]