RE: [PHP-GTK] Sessions with PHP 4.1.2
| From: | Gavin M. Roy | Date: | Tue, 12 Mar 2002 21:29:48 +0000 |
| Subject: | RE: [PHP-GTK] Sessions with PHP 4.1.2 | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-1494@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You should ask this on the general php email lists or over at a site
like phpbuilder.com. This list is specific to php-gtk, that is using
php with the gtk toolkit for non-webbased php applications.
Good luck,
Gavin
- -----Original Message-----
From: Johannes Hiemer [mailto:jhiemer@web.de]
Sent: Tuesday, March 12, 2002 11:54 AM
To: php-gtk-general@lists.php.net
Subject: [PHP-GTK] Sessions with PHP 4.1.2
Hi,
my friend and me programed a PHP and MySQL-based Online-Calendar.
Everythings fine!
But at home on my IIS 5 with MySQL and PHP 4.1.2 I got a lot problems
with
the Sessions.
For example Errors like this:
- - Warning: Session object destruction failed in
D:\Deppchef\2\kalender\index.php on line 16
- -Warning: Session object destruction failed in
D:\Deppchef\2\kalender\index.php on line 16
- -Warning: Cannot send session cache limiter - headers already sent
(output
started at D:\Deppchef\2\kalender\index.php:16) in
D:\Deppchef\2\kalender\index.php on line 44
- -Warning: open(/tmp\sess_116fe6b9efa8116c64ce7d2059f2ea99, O_RDWR)
failed:
No such file or directory (2) in D:\Deppchef\2\kalender\index.php on
line 44
- -Warning: Cannot add header information - headers already sent by
(output
started at D:\Deppchef\2\kalender\index.php:16) in
D:\Deppchef\2\kalender\index.php on line 47
- -Warning: open(/tmp\sess_116fe6b9efa8116c64ce7d2059f2ea99, O_RDWR)
failed:
No such file or directory (2) in Unknown on line 0
- -Warning: Failed to write session data (files). Please verify that
the
current setting of session.save_path is correct (/tmp) in Unknown on
line 0
This Errors are created by this code:
<?php
include ("inc/template.inc.php");
//
phplib-template einbinden
include ("inc/tpl_news_db.inc.php");
$tpl = new template();
$db = new DB_TplNews();
@session_start();
$delete = new DB_TplNews();
$aktuelle_zeit = time()-600;
$delete->query("DELETE FROM sessions WHERE datum < $aktuelle_zeit");
session_start();
$test = $delete->reihe("SELECT * FROM sessions where
session_id='$session_id'");
if(!$test)
{
session_destroy();
}
if(isset($session_id))
{
$delete->query("SELECT ebene FROM sessions where
session_id='$session_id'");
while($delete->next_record())
{
$ebene = $delete->f("ebene");
}
header("LOCATION: index_log.php4");
}
else
{
if($passwort!="" AND $username!="")
{
$db->query("SELECT * FROM user WHERE username='$username' AND
passwort='$passwort'");
while($db->next_record())
{
$id_user = $db->f("id_user");
$ebene_user = $db->f("ebene");
}
$true = $db->Row;
if($true==2)
{
srand((double)microtime()*1000000);
$session_id = md5(uniqid(rand()));
session_register("session_id","id_user","ebene_user");
$zeit = time();
$db->query("INSERT INTO sessions (session_id,
id_user,ebene,datum) VALUES
('$session_id','$id_user','$ebene','$zeit')");
header("LOCATION: index_log.php4");
}
else
{
header("LOCATION: index.php4");
}
}
else
{
$tpl->set_file(array(
"page" => "tpl/login/index2.html",
"login" => "tpl/login/index.html"
));
$tpl->set_var(array(
"PHP" => $PHP_SELF
));
$tpl->parse("out","login");
$tpl->parse("out","page");
$tpl->p("out");
}
}
?>
But what is wrong?
thx Johannes Hiemer
- --
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPI5zTH9xeBXAlKqsEQJNhACgofkJBD+KpgsK5oYLzwTS2NDn+wQAn1zc
8Gaw6x8jTG43+/I0aC+2ZT9h
=V6Ls
-----END PGP SIGNATURE-----