Hi all,i need help regarding saving session into mysql and use it..Right now i'm using this code...
auth.php
member.phpCode:session_start();
include('db.inc.php');
$email=mysql_real_escape_string($_POST['email']);
$pwd=mysql_real_escape_string($_POST['pwd']);
$sql="Select member_id,email,password,nama,type from users where email='$email' and password=md5('$pwd')";
$exec=mysql_query($sql);
$result=mysql_fetch_array($exec);
if ($result['type'] == "member")
{
$_SESSION['nama']=$result['nama'];
$_SESSION['id']=$result['member_id'];
header('location:member.php');
}
else
{
echo 'Anda gagal login';
header('location:index.php');
}
What should i do to save the session into mysql..I don't have a clue...Thanks a lot...Code:session_start();
include('output_fns.php');
if(!$_SESSION['nama'])
{
header('location:index.php');
}
else
{
do_kepala('Member');
echo 'Welcome ' . $_SESSION['nama'];
menu_member();


LinkBack URL
About LinkBacks




Reply With Quote




Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum