hi all
Posted: Sat Mar 28, 2009 11:07 am
hi all i am makeing a website but i have got a problem i need some code that choses bewteen log in user and a non log in user. any awnser will be great thanks in advance lee
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
CheckSession.php
<?php
session_start();
if(!isset($_SESSION['userid'])){
heder('location: login.php');
exit();
}
?>
Code: Select all
login.php
Ask for user authentication in there using <form>, <input> and <submit> tagsCode: Select all
dologin.php
<?php
session_start();
/*Use the database to validate login credentials then*/
if($validlogin == true){
$_SESSION['userid'] = $userid;
header('location: firstpage.php');
exit();
}
?>