LooieENG Posted June 29, 2008 Share Posted June 29, 2008 How do you prevent it? (stop it showing if there's a MySQL error) Link to comment https://forums.phpfreaks.com/topic/112495-full-path-disclosure/ Share on other sites More sharing options...
trq Posted June 29, 2008 Share Posted June 29, 2008 Disable display_errors. Link to comment https://forums.phpfreaks.com/topic/112495-full-path-disclosure/#findComment-577614 Share on other sites More sharing options...
papaface Posted June 29, 2008 Share Posted June 29, 2008 @mysql_query("SOMEQUERY"); BUT THIS IS VERY BAD PRACTICE! Better to do something like: mysql_query("SOMEQUERY") or die ("An error has ocurred on line * of your code."); Link to comment https://forums.phpfreaks.com/topic/112495-full-path-disclosure/#findComment-577615 Share on other sites More sharing options...
br0ken Posted June 29, 2008 Share Posted June 29, 2008 I personally don't think the error suppressing @ symbol is so bad. I've encapsulated my database functions into a class so I supress the errors using the @ symbol but then manually check for errors using mysql_error(), handle them/report them and exit gracefully rather than just using die() and getting a naff looking error message. I admit it can be used in a bad way but so can everything in PHP! Link to comment https://forums.phpfreaks.com/topic/112495-full-path-disclosure/#findComment-577620 Share on other sites More sharing options...
LooieENG Posted June 30, 2008 Author Share Posted June 30, 2008 @mysql_query("SOMEQUERY"); BUT THIS IS VERY BAD PRACTICE! Better to do something like: mysql_query("SOMEQUERY") or die ("An error has ocurred on line * of your code."); I tried that, and then changed a character in my mysql pass, but it just did mysql error cannot connect with password yes blah blah (full path) 'my error message' Link to comment https://forums.phpfreaks.com/topic/112495-full-path-disclosure/#findComment-577734 Share on other sites More sharing options...
br0ken Posted June 30, 2008 Share Posted June 30, 2008 <?php $rs = @mysql_query("SOMEQUERY"); if (mysql_error()) { echo "Unknown Database Error<br />"; exit; } ?> I would advise adding some form of error reporting system into this. I have an email system that sends me an email containing the query and the message in mysql_error(). Link to comment https://forums.phpfreaks.com/topic/112495-full-path-disclosure/#findComment-578138 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.