Jump to content

Full path disclosure?


LooieENG

Recommended Posts

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

@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

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

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.