Jump to content


Photo

error_reporter


  • Please log in to reply
2 replies to this topic

#1 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 24 September 2006 - 09:43 PM

Hey

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

BUT
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?

Tell me the problem, I will try tell you the solution

#2 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 24 September 2006 - 09:51 PM

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.

#3 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 24 September 2006 - 10:12 PM

ok

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
Thanks
Tell me the problem, I will try tell you the solution




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users