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:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 10:13 AM
> To: [EMAIL PROTECTED]
> 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
> 
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to