RE: [PHP] sessions . . . .

From: Date: Mon, 16 Jul 2001 15:05:50 +0000
Subject: RE: [PHP] sessions . . . .
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-58058@lists.php.net to get a copy of this message
any number of things could happen to the $directory variable... it could be out of scope, gotten overwritten or unset by another function, or it might just never have been saved to the database... but the real problem with that code is that there are no error checks on the file functions. that is a bad thing. you should *always* check file operations for errors. $fp = fopen( ... ) or die("Cannot open"); > -----Original Message----- > From: Jon Yaggie [mailto:dmsales@design-monster.com] > Sent: Monday, July 16, 2001 10:13 AM > To: php-general@lists.php.net > Subject: [PHP] sessions . . . . > > > i have three pages all begin with session_start() one fo the variables i > register on the first page si $directory which is used to create a unique > and temp directory for user files. in the first this is some stuff saved > tot his directory. in the second page there is information pulled fromt > this directory. in the third when i try to save to it i get the following erros > > > Warning: fopen("/body.html","a+") - Permission denied in > /home/www/hvacsites.com/SiteBuilder/control.php on line 35 > > Warning: Supplied argument is not a valid File-Handle resource in > /home/www/hvacsites.com/SiteBuilder/control.php on line 36 > > Warning: Supplied argument is not a valid File-Handle resource in > /home/www/hvacsites.com/SiteBuilder/control.php on line 37 > > from the code > > $pg_info .= "</table>"; > $file = "$directory/body.html"; > $handle = fopen($file, "a+"); > fputs($handle, $pg_info); > fclose($handle); > > as you can see in the error $directory appears not to be there. i didnt > unregister it. i didnt change it. where did it go? and what might have > cause this?? > > > > Thank You, > > Jon Yaggie > www.design-monster.com > > And they were singing . . . > > '100 little bugs in the code > 100 bugs in the code > fix one bug, compile it again > 101 little bugs in the code > > 101 little bugs in the code . . .' > > And it continued until they reached 0 > > >

« previous php.general (#58058) next »