Jump to content

about login


chichi29

Recommended Posts

i dont suggest doing this

 

http://www.htmlgoodies.com/tutorials/buttons/article.php/3478911

 

not secure as its javascript can be turned off

 

1) You can use the location replace method when changing the location. This replaces the current history location with the new location. However older browsers do not support this method, which is why it is required to test for the images object:

<script language="JavaScript"><!--
if (document.images)
location.replace('http://www.somewhere.com/apage.html');
else
location.href = 'apage.html';
//--></script>

im no javascript wizard but i think that might work out as i said tho it isnt the best practice and i wonder why you would want to do it

 

 

 

 

Note: in Opera replace() will work, but only with absolute URL's. ....

 

 

 

 

also if your using sessions then just have logout destroy the session then pressing the back buttons will not access the data

 

add this to the pages

 

<?php
session_start( ); 
if(!isset($_SESSION["username"])){
header('Location: /login.php');
}
else
{
?>

Page goes here
}?>

Link to comment
https://forums.phpfreaks.com/topic/147401-about-login/#findComment-773692
Share on other sites

session destroy

 

<?php
session_start();
if( session_unregister('loginid') == true && session_unregister('username')==true ) {
session_destroy();
header('Location: index.php');
  } else {
   unset($_SESSION['loginid']);
   unset($_SESSION['username']);
   session_destroy();
   header('Location: index.php');
}
?>

Link to comment
https://forums.phpfreaks.com/topic/147401-about-login/#findComment-773694
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.