The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

Browse by Tags

All Tags » PHP (RSS)
  • Scaling MySQL and PHP

    I know there are many ways to scale MySQL, but specifically I am interested in Master, Slave, Slave,... scaling. Doing this with MySQL I can find fully documented on their site, so I don't need help with that (at least, not yet). I have a few ideas in mind on how to handle this in PHP. My main idea...
    Posted to Forum by helpfulcorn on 11-21-2008
  • Ad network site from hell

    About four years ago I was working for a small company that did PHP based web sites. When I first started, I was a bit alarmed that the owner got most of his clients from sites like ELance, but I figured "If it works, why not". The first projects I worked on were fairly simple, a lot were fixing...
    Posted to Forum by helpfulcorn on 11-21-2008
  • Re: $_SESSION[everything]

    Building on some earlier code, I've put together 2 functions that send email to you upon failure. // Set debug email - place this here or somewhere else define('DEBUG_EMAIL','developer@yourdomain.com'); /* Connects to a MySQL server and selects requested database, will die() upon...
    Posted to Forum by nion on 10-17-2008
  • Re: PHP Action Routing Done Wrong

    Why not just: switch($_GET['action']) { case 'blah': include('/inc/blah.php'); break; case 'dildo': include('/inc/other_stuff.php'); break; default: include('really_other_stuff.php'); break; } Easier to read than "elseif"s, easy to maintain, no...
    Posted to Forum by EJ_ on 09-08-2008
  • Re: PHP Action Routing Done Wrong

    $actions = Array('foo', 'bar', 'baz'); if(in_array($actions, $_GET['action'])) require("$_GET[action].php"); else { //do something about it }
    Posted to Forum by lolwtf on 09-04-2008
  • One way to generate a password...

    At least it's indented correctly, unlike most of this developer's other code: function generate_password($length,$level){ list($usec, $sec) = explode(' ', microtime()); srand((float) $sec + ((float) $usec * 100000)); $validchars[1] = "0123456789"; $validchars[2] = "abcdfghjkmnpqrstvwxyz";...
    Posted to Forum by elitheeli on 08-31-2008
  • A 908,000+ record insert query (PHP issue)

    Although calling this a PHP issue is kinda moot. I was hired to do up a quick import script to pull third party information into a database. I was given some test data, access to the server I'm importing to, and a good luck message. In short order, I managed to figure out the schema, and get a PHP...
    Posted to Forum by Consul on 08-04-2008
  • php fork() on windows

    After making some php program, or script for that matter i'm trying to fork a process so the script continues, on a win32 platform: <?php servername(); function servername() { $servername = "EMPTY"; while ($servername != "") { fwrite(STDOUT, "Server: "); $servername...
    Posted to Forum by Bodyglove on 08-02-2008
  • sprintf("%s", $string): A few gems from the RAID controller I'm working on

    I'm currently in the process of customizing the firmware for a RAID controller used in some of my company's products. The LCD Controller Module (LCM) is written in PHP, a task for which PHP was NOT designed for. In addition to abusing exec all over the place, they poorly re-implement functions...
    Posted to Forum by jspenguin on 05-21-2008
  • Re: MSDN Magazine Homepage PHPSESSID WTF

    [quote user="huseyint"]Let's say there are 100 incoming links to MSDN Magazine Homepage with anchor texts "msdn magazine" and let 10 of these come from those crappy forum software with PHPSESSID appended to them. If Google is so intelligent, it will not promote those 10 links...
    Posted to Forum by dtech on 05-10-2008
Page 1 of 4 (38 items) 1 2 3 4 Next >
Powered by Community Server (Non-Commercial Edition), by Telligent Systems