Multiple tab prevent

PEAR, Smarty, ADOdb, OOP, PHP 5, XML, UML, Şabloane de proiectare, PHP-GTK.

Moderatori: coditza, Emil, Moderatori

Avatar utilizator
UnTip
Senior Member
Mesaje: 389
Membru din: Joi Mai 03, 2007 1:55 pm

Multiple tab prevent

Mesajde UnTip » Mar Dec 07, 2010 11:53 am



"Nothing has such power to broaden the mind as the ability to investigate systematically and truly all that comes under thy observation in life. "

ice_rider
PHPRomania Supporter
Mesaje: 23
Membru din: Mie Mai 12, 2010 2:11 pm

Re: Multiple tab prevent

Mesajde ice_rider » Mar Dec 07, 2010 2:06 pm


Avatar utilizator
UnTip
Senior Member
Mesaje: 389
Membru din: Joi Mai 03, 2007 1:55 pm

Mesajde UnTip » Mar Dec 07, 2010 2:18 pm

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'];?>&amp;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. "

Avatar utilizator
vectorialpx
Senior Member
Mesaje: 4832
Membru din: Mar Mar 01, 2005 9:48 am
Localitate: Bucuresti
Contact:

Mesajde vectorialpx » Vin Dec 10, 2010 9:23 am

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]

Avatar utilizator
UnTip
Senior Member
Mesaje: 389
Membru din: Joi Mai 03, 2007 1:55 pm

Mesajde UnTip » Vin Dec 10, 2010 9:24 am

nu pot elimina refresh-ul,
regula trebie sa fie First in first out...
"Nothing has such power to broaden the mind as the ability to investigate systematically and truly all that comes under thy observation in life. "


Înapoi la “PHP Avansat”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 7 vizitatori