Hi,
hab jetzt mal probiert dies alles in ner Klasse unterzubringen. Könnte das so funktionieren, wie ich es oben beschrieben hab?
Ciao
Luna2004
<script language = "php">
class Session
{
var $Sessionid_generieren;
var $Session;
function new sessionid()
{
return uniquid(md5($GLBOALS["SERVER_ADDR"])."-");
$myDB= new db("Test", "root" , "");
$cursor=$myDB->sql("UPDATE sessionid from Session where Sessionid = '$Sessionid'");
$result=$myDB->fetch_all();
}
function new session()
{
if
{
$timeout=60*5 //Timeout in 5 Min
$sessionid=sessionid();
$myDB= new db("Test", "root" , "");
$cursor=$myDB->sql("SELECT time from Session where Sessionid = '$Sessionid'");
$result=$myDB->fetch_all();
}
if (time()>$result["time"]+$timeout)
$myDB= new db("Test", "root" , "");
$cursor=$myDB->sql("DELETE Sessionid from Session where Sessionid = '$Sessionid'");
}
else
{
$myDB= new db("Test", "root" , "");
$cursor=$myDB->sql("UPDATE Session SET (time='".time()"') where Sessionid = '$Sessionid'");
$result=$myDB->fetch_all();
}
}
</script>
hab jetzt mal probiert dies alles in ner Klasse unterzubringen. Könnte das so funktionieren, wie ich es oben beschrieben hab?
Ciao
Luna2004
<script language = "php">
class Session
{
var $Sessionid_generieren;
var $Session;
function new sessionid()
{
return uniquid(md5($GLBOALS["SERVER_ADDR"])."-");
$myDB= new db("Test", "root" , "");
$cursor=$myDB->sql("UPDATE sessionid from Session where Sessionid = '$Sessionid'");
$result=$myDB->fetch_all();
}
function new session()
{
if
{
$timeout=60*5 //Timeout in 5 Min
$sessionid=sessionid();
$myDB= new db("Test", "root" , "");
$cursor=$myDB->sql("SELECT time from Session where Sessionid = '$Sessionid'");
$result=$myDB->fetch_all();
}
if (time()>$result["time"]+$timeout)
$myDB= new db("Test", "root" , "");
$cursor=$myDB->sql("DELETE Sessionid from Session where Sessionid = '$Sessionid'");
}
else
{
$myDB= new db("Test", "root" , "");
$cursor=$myDB->sql("UPDATE Session SET (time='".time()"') where Sessionid = '$Sessionid'");
$result=$myDB->fetch_all();
}
}
</script>