HTML interesse |
|
if($_SERVER['REMOTE_ADDR'] != $_SESSION['sess_ip']) {
// invalid session / hack
die();
}
if($_SERVER['REMOTE_ADDR'] != $_SESSION['sess_ip']) { // invalid session / hack }
dacht ik
edit: dit is een verbeterde versie:
<?
// deze code kijkt naar ip: XXX.XXX.???.???
$jouw_login_url = 'http://www.domain.ext/login.php';
$ip = explode('.',$_SERVER['REMOTE_ADDR']);
$sess_ip = explode('.',$_SESSION['sess_ip']);
$first_ip = $ip[0].'.'$ip[1];
$first_sess_ip = $sess_ip[0].'.'.$sess_ip[1];
if($first_ip != $first_sess_ip) {
// invalid session / hack
header("Location: ".$jouw_login_url);
die('<script>window.location=\''.$jouw_login_url.'\';</script>');
}
<? // deze code kijkt naar ip: XXX.XXX.???.??? $jouw_login_url = 'http://www.domain.ext/login.php'; $ip = explode('.',$_SERVER['REMOTE_ADDR']); $sess_ip = explode('.',$_SESSION['sess_ip']); $first_ip = $ip[0].'.'$ip[1]; $first_sess_ip = $sess_ip[0].'.'.$sess_ip[1]; if($first_ip != $first_sess_ip) { // invalid session / hack header("Location: ".$jouw_login_url); die('<script>window.location=\''.$jouw_login_url.'\ ';</script>'); }
|