Image

Imagedarkrose wrote in Imagephp

Dumb question..

I have kind of a weird/dumb question.

I want to return a custom error message to a templated page should fopen() not be able to write to a file for some reason. I don't know exactly where to go with this. Can someone gimme some hints as to where to find some sample code for doing this?



$open_file=@fopen($location, 'w+');
if($open_file =! false){
fwrite($open_file, $editresult);
fclose($open_file);
header("Location: editcss.php?SID=$session&css_var=$css_var");
}else{
$error.="$language_cantwrite";
}

I know this code won't work, but how do I validate the fopen output (or lack thereof)?

Difficulty: These are style sheets they're editing.