Hi,
I own a wallpaper site and each wallpaper has a comment box for users to post their comments (MySQL is NOT USED).
Each wallpaper requires a file to be created with the same name as the wallpaper e.g if the wallpaper was called britney_spears_001.jpg, the file to be created would be called britney_spears_001.cmt.
Each of these .cmt files need to be CHMODed 777 which is really annoying to create one for each wallpaper and CHMOD it.
When my users have typed in their comments they click "submit" and it calls the comments.php file which writes their comments to the .cmt file for that wallpaper.
What I would like to know is, is it possible to make the comments.php file create the .cmt file if it doesn't exist?
i.e. if I hadn't already created the britney_spears_001.cmt file then it would create it, CHMOD it and then write to it.
The code which I currently use to write to the file is
<?
global $HTTP_POST_VARS;
fopen("$cmt", "a+");
$br="<tr><td><br><b>$name</b><br>$comments<br><br></td></tr>";
$write=fopen("$cmt","a+");
fwrite($write,$br);
fclose($write);
?>
This will save lots of time if it is possible to do it.