got the host to post me a phpinfo of their server setup, 70%(what I bothered looking at) was the same, except for the session.save_path, but that makes sense (i think)
loginScript.php:
<?php
$Username=$_POST['username'];
$Password=$_POST['password'];
$loginpage = "http://www.google.com.au/login.html";
$failedpage = "failed.html";
session_start(); # must do this on each page a $_SESSION var is needed/used
$users[0] = array("guest", "access", "temp/index.php");
$users[1] = array("user1", "pass1", "user1/index.php");
$users[2] = array("user2", "pass2", "user2/index.php");
$users[3] = array("user3", "pass3", "user3/index.php");
$members = count($users);
for($x=0; $x<$members; $x++){ # loop 4 (number of members) times...
if(($Username==$users[$x][0])&&($Password==$users[$x][1])){ #if the posted username and password match a user's then:
$_SESSION['loggedin'] = 1; # assign a logged in status to this var
$_SESSION['member'] = $x; # assign the user's number to this var
$successpage=$users[$x][2];
header("Location: $successpage"); # send this user to his successpage
}
} # if none of the username/password combos match, then:
//header ("Location: $failedpage"); # send this user to the fail page
echo "You are not permitted.";
?>
index.php files(similar to):
<?PHP
session_start();
if ($_SESSION['member']!==0){
header("Location: ../login.html"); # send 'em back to login page
}else{?>
I used a loginCheck (to make me feel better)
loginCheck.php
<?php
session_start();
header("Cache-control: private"); //IE 6 Fix
echo "Sessions: <pre>";
print_r($_SESSION);
echo "</pre>";
?>
It returned stuff on the localhost, but not on the hosted page.
I just wanna work it out so if it's a prob with the host server they can fix it. But I don't know enough to know.