Jump to content


This topic is now archived and is closed to further replies.



Recommended Posts


I am building an error_reporter thing for when queries go wrong

Now, as it is for queries, I guess tryna add to a MySQL DB is not a wise idea

So I was thinking of writing to a text document

if I write to a text document in the root of the website, and someone finds it, then they will see all the erorr details
The query, the mysql_error() message, the date, the page ect

Too much information to leave open

So 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 777

This means having a 777 in the Web Directory, which I dont think is a good idea now

Anyone have any better suggestions on doing this?

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites

I 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 write
So 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 wicked

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.