onlyican Posted September 24, 2006 Share Posted September 24, 2006 HeyI am building an error_reporter thing for when queries go wrongNow, as it is for queries, I guess tryna add to a MySQL DB is not a wise ideaSo I was thinking of writing to a text documentBUTif I write to a text document in the root of the website, and someone finds it, then they will see all the erorr detailsThe query, the mysql_error() message, the date, the page ectToo much information to leave openSo I was thinking of adding it to the root of the web directory (Below public_html folder)But when using fopen, fwrite, fclose, the dir needs to be 777This means having a 777 in the Web Directory, which I dont think is a good idea nowAnyone have any better suggestions on doing this? Quote Link to comment Share on other sites More sharing options...
alpine Posted September 24, 2006 Share Posted September 24, 2006 chmod("/somedir/somefile", 0600); is read and write for file owner, nothing for anyone else (ref. manual)You should however be pretty safe if you store your file in a folder and leaves an empty index.html file along with it. No one can find the file unless they know its secret name. Quote Link to comment Share on other sites More sharing options...
onlyican Posted September 24, 2006 Author Share Posted September 24, 2006 okI have put the file in the website root (same as the index.php file for that website)I tried using chmod 0600, but it failed to writeSo I tried 222 (Everyone write, nobody read or execute)and I can write, and if I go to that file, it is a 403 (Forbidden)Which is wickedThanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.