Reseller Domain Murah dan termurah di Indonesia? ya di ResellerCamp.
         
 

Forum PHP Indonesia

 
Advanced Search
   
 
Home Register FAQ Memberlist Usergroups  
 
 

Forum PHP Indonesia Forum Index Session & Cookie mohon bantuannya kk
Display posts from previous:   
      All times are GMT + 7 Hours  

mohon bantuannya kk

Post new topic  Reply to topic

Fri Jul 16, 2010 11:36
Author Message
ozil
PHPnewbie
PHPnewbie


Joined: 14 Jul 2010
Posts: 9

Post subject: mohon bantuannya kk Reply with quote

gini mas....pas udah logout....diklik tombol back di browser saya kok bisa balek ke halaman sblomnya..padahal sudah di session_destroy();...mohon pencerahannya mas....

ni saya tampilkan kan login.php dan logout.php saya...

login.php

<?php
include "koneksi.php";

$pass = $_POST[password];
$nama = $_POST[username];
$login = mysql_query("SELECT * FROM customer WHERE nama='$nama' AND Password='$pass'");
$ketemu = mysql_num_rows($login);
$r = mysql_fetch_array($login);

// Apabila username dan password ditemukan
if ($ketemu > 0){

session_start();
session_register("namauser");
session_register("passuser");

$_SESSION[namauser]=$r[nama];
$_SESSION[passuser]=$r[password];
header('location:index.php?module=home');
session_start();

}

else{
$salah=salah;
header('location:index.php');
}
?>


buat logout phpnya....

<?php
session_start();
session_destroy();
header("location: home_login.php");
?>

maaf masih nubi kk Cry Cry
 
View user's profile Send private message Yahoo Messenger
      Back To Top  

Fri Jul 16, 2010 11:43
Author Message
ozil
PHPnewbie
PHPnewbie


Joined: 14 Jul 2010
Posts: 9

Post subject: Reply with quote

Cry
 
View user's profile Send private message Yahoo Messenger
      Back To Top  

Fri Jul 16, 2010 19:20
Author Message
andriant
Jagoan PHP
Jagoan PHP


Joined: 31 Mar 2010
Posts: 911
Location: Jakarta

Post subject: Reply with quote

udah di cek belum di halaman yang harus login.
dipasangin:
[code]
if ($_SESSION["namauser"] == "")
{
header("location: home_login.php");
}
 
View user's profile Send private message Visit poster's website Yahoo Messenger
      Back To Top  

Fri Jul 16, 2010 20:09
Author Message
musicanda
PHP Master
PHP Master


Joined: 02 Jun 2010
Posts: 263
Location: Rumahnya Angeline

Post subject: Re: mohon bantuannya kk Reply with quote

ozil wrote:
gini mas....pas udah logout....diklik tombol back di browser saya kok bisa balek ke halaman sblomnya..padahal sudah di session_destroy();...mohon pencerahannya mas....

ni saya tampilkan kan login.php dan logout.php saya...

login.php

<?php
include "koneksi.php";

$pass = $_POST[password];
$nama = $_POST[username];
$login = mysql_query("SELECT * FROM customer WHERE nama='$nama' AND Password='$pass'");
$ketemu = mysql_num_rows($login);
$r = mysql_fetch_array($login);

// Apabila username dan password ditemukan
if ($ketemu > 0){

session_start();
session_register("namauser");
session_register("passuser");

$_SESSION[namauser]=$r[nama];
$_SESSION[passuser]=$r[password];
header('location:index.php?module=home');
session_start();

}

else{
$salah=salah;
header('location:index.php');
}
?>


buat logout phpnya....

<?php
session_start();
session_destroy();
header("location: home_login.php");
?>

maaf masih nubi kk Cry Cry




ubah jadi gini mas skrip ini...

<?php
session_start();
//tambahkan fungsi unset
unset('variabel session yang sudah mas daftarkan');
session_destroy();
header("location: home_login.php");
?>


semoga bermanfaat Big Smile
 
View user's profile Send private message Send e-mail Visit poster's website
      Back To Top  

Mon Jul 19, 2010 12:57
Author Message
ozil
PHPnewbie
PHPnewbie


Joined: 14 Jul 2010
Posts: 9

Post subject: Reply with quote

terima kasih mas2 smua..... Big Smile Weks
 
View user's profile Send private message Yahoo Messenger
      Back To Top  

Mon Jul 19, 2010 21:05
Author Message
musicanda
PHP Master
PHP Master


Joined: 02 Jun 2010
Posts: 263
Location: Rumahnya Angeline

Post subject: Reply with quote

Big Smile
 
View user's profile Send private message Send e-mail Visit poster's website
      Back To Top  

Wed Jan 05, 2011 16:55
Author Message
whois
PHPuser
PHPuser


Joined: 31 Dec 2010
Posts: 40

Post subject: Reply with quote

Numpang nyontek y Weks
_________________
www.whoisdomain.net
 
View user's profile Send private message Visit poster's website
      Back To Top  
Post new topic  Reply to topic

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


      Back To Top  

Page 1 of 1
Jump to:  
Powered by phpBB © 2001, 2002 phpBB Group
Toko Kaos Couple | Avalanche style by What Is Real © 2004 | Toko Baju Butik Online | Cara Pedia | Busana Baju Muslim