Authenticating
Posted: Wed Mar 29, 2006 5:17 pm
I have the code
validation page
Authentication page
final site
Now,
All I want to do is make sure that the 'final site' functions cannot be access unless the user is authenticated, everything else works fine, except that the final site always thinks that the user is not authenticated. I know I'm not passing something correctly or something, can someone just give me a quick helping hand. When that page is access even with the correct login the end result will always link to 'http://www.telstra.com' instead of http://www.google.com.au, as I have put these links in for testing, just to see if it works. the correct result should link to google
thanx, a quick response would be most appreciated
thanx in advanced
validation page
Code: Select all
if('bob' == $_POST['user_name'] and 'milk' == $_POST['password'])
{
header('Location: authenticated.php');
}
elseif('larry' == $_POST['user_name'] and 'juice' == $_POST['password'])
{
header('Location: http://forums.devnetwork.net');
}
exit;Code: Select all
<?php
session_start();
$_SESSION['authenticated'] = TRUE;
header('Location: site.php');
?>Code: Select all
<?php
if(!$_SESSION['authenticated'])
{
header('Location: http://www.telstra.com');
}
else
{
header('Location: http://www.google.com.au');
}
?>All I want to do is make sure that the 'final site' functions cannot be access unless the user is authenticated, everything else works fine, except that the final site always thinks that the user is not authenticated. I know I'm not passing something correctly or something, can someone just give me a quick helping hand. When that page is access even with the correct login the end result will always link to 'http://www.telstra.com' instead of http://www.google.com.au, as I have put these links in for testing, just to see if it works. the correct result should link to google
thanx, a quick response would be most appreciated
thanx in advanced