Jump to content

[SOLVED] Outputing error's to email


timmy2

Recommended Posts

Dont think is smth very easy or automated. Even so, u should do some error handling and for those functions which can cause errors (like: mysql_query, fopen etc) u could send an email. One idea is to make a function ex. sendMail($msg) where u define the headers and all that staff for the mail, and use:

 

$query = "SELECT * FROM table";
$results = @mysql_query($query) or sendMail("Query $query cause an error");

 

Thats what i can think about.

@GuiltyGear

$results = @mysql_query($query) or sendMail("Query $query cause an error");
[\code]

why do you have ("@") i always see this in this forum i hate it im scratching my head putting this kind of thing simply mean that the code is not perfect or you anticipate for the wrong output 

As i said i always use '@' as a security measure, after ive tested my code. Plus someone can inject code in your query string and without @ it will bring up the real error message, showing up important data. Maybe u can protect your code well, but think it twice, those '@' arent created to use them for fun.

Archived

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

×
×
  • Create New...

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.