Multiple tab prevent
Moderatori: coditza, Emil, Moderatori
Multiple tab prevent
"Nothing has such power to broaden the mind as the ability to investigate systematically and truly all that comes under thy observation in life. "
un exemplu ar fi
$chv=md5(date("YmdHis").microtime());
if(isset($_POST['chv'])){
$chv=$_POST['chv'];
}
if($_SERVER['REQUEST_METHOD']!="POST"){
$_SESSION['chv']=$chv;
}
if(isset($_POST['finalizare_x'])){
if(!isset($_SESSION['chv'])){
$_SESSION['chv']=$chv;
}
if($_SESSION['chv']!=$_POST['chv']){
die("<h1>Nu puteti avea sesiuni multiple (tab-uri in acelasi browser,ferestre in aceeasi aplicatie)</h1>");
}//end on 9'nth big if
} //end post
?>
<form id="formularfinal" name="formularfinal" method="post" action="pg2.php?asig=<?php echo $_GET['asig'];?>&prima=<?php echo $_GET['prima'];?>">
<input type="hidden" id="chv" name="chv" value="<?php echo $chv; ?>" />
o alternativa la lucrul asta?
$chv=md5(date("YmdHis").microtime());
if(isset($_POST['chv'])){
$chv=$_POST['chv'];
}
if($_SERVER['REQUEST_METHOD']!="POST"){
$_SESSION['chv']=$chv;
}
if(isset($_POST['finalizare_x'])){
if(!isset($_SESSION['chv'])){
$_SESSION['chv']=$chv;
}
if($_SESSION['chv']!=$_POST['chv']){
die("<h1>Nu puteti avea sesiuni multiple (tab-uri in acelasi browser,ferestre in aceeasi aplicatie)</h1>");
}//end on 9'nth big if
} //end post
?>
<form id="formularfinal" name="formularfinal" method="post" action="pg2.php?asig=<?php echo $_GET['asig'];?>&prima=<?php echo $_GET['prima'];?>">
<input type="hidden" id="chv" name="chv" value="<?php echo $chv; ?>" />
o alternativa la lucrul asta?
"Nothing has such power to broaden the mind as the ability to investigate systematically and truly all that comes under thy observation in life. "
- vectorialpx
- Senior Member
- Mesaje: 4832
- Membru din: Mar Mar 01, 2005 9:48 am
- Localitate: Bucuresti
- Contact:
poti sa dezvolti ideea asta:
[php] <?php session_start();
$ruri = $_SERVER['REQUEST_URI'];
if(isset($_SESSION['current_page']) && $_SESSION['current_page'] == $ruri)
die('Aceasta pagina este deja deschisa!');
$_SESSION['current_page'] = $ruri;
// problema este ca acum nu poti da refresh,
// trebuie doar sa navighezi de la un link la altul
// dar nu am timp sa dezvolt acum
?> [/php]
[php] <?php session_start();
$ruri = $_SERVER['REQUEST_URI'];
if(isset($_SESSION['current_page']) && $_SESSION['current_page'] == $ruri)
die('Aceasta pagina este deja deschisa!');
$_SESSION['current_page'] = $ruri;
// problema este ca acum nu poti da refresh,
// trebuie doar sa navighezi de la un link la altul
// dar nu am timp sa dezvolt acum
?> [/php]
Cine este conectat
Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 6 vizitatori
