Hi - I'm a major newbie.

 - I have a file that pulls an include into a <textarea> for a user to edit
 - before pulling the include, I'd like to open it and check it's value
 - if the include's value is exactly equal to the string:
<div style='color: #eee; font: bold 80px Georgia, serif'>Hello World</div>
then I want to overwrite that string with nothing; close the include; and
then load it (now null) into the textarea
 - else, if the include's value is not equal to the above string, just load
it into the <textarea>

However embarrassing, I'll give what I have which hasn't been working

$noting = "";
$checkval = "<div style='color: #F00; font: bold 80px Georgia, serif'>Hello
World</div>";
$filename = "thefile.inc";

$fd = fopen ($filename, "w");
$contents = fread ($fd, filesize ($filename));
if ($contents == fread ($checkval)) {
    fwrite ($filename, $nothing);
    fclose ($fd);
    include($filename);
     } else {
     fclose ($fd);
     include($filename);
}
clearstatcache();    //for the next time around?

Also - does thefile.inc have to be CHMOD 666?
BTW - the server is running PHP4/Apache.

thx    //t



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to