Skip navigation.
Home

DB Hoopla

The magic in header.inc.php...

DB Hoopla | Wonky Code

Last week we looked at PHP's limited MySQL functionality. Today we have another example for the PHP guys to improve the MySQL library. That's sarcasm for those that missed it the first time.

On a more WTF note, I wonder what's inside header.inc.php. Especially since it is included into the code like nine times! Anybody know the difference between using include() versus require()?

Thanks to Stefan for sending this in.

Why check one password when you can check them all...

DB Hoopla

Of all the WTF submissions I've gotten, this is one that I actually wanted to confirm. I didn't think anybody, no matter how beginner would pull something like this:

<?php
$query
= "SELECT * FROM passwords";
$mysql_result = mysql_query($query, $mysql_link);
while(
$row = mysql_fetch_array($mysql_result)) {
   if (
$row[0] == $passwd){
                 print(
"ok");
                 return
0;
   }
}
?>

Short and not so sweet. Thanks to Piotr Budny for sending this in. Somebody complained that his web sites wasn't working so Piotr dug into it and found today's WTF! Yikes!

XML feed