<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>ProDevTips - Latest Comments in The worst PHP code in the world</title><link>http://prodevtips.disqus.com/</link><description>Mainly tutorials and tips relating to web development with PHP, Javascript, jQuery and Ruby</description><atom:link href="https://prodevtips.disqus.com/the_worst_php_code_in_the_world/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 01 Oct 2008 11:33:12 -0000</lastBuildDate><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-2779564</link><description>&lt;p&gt;I'm sitting in the office looking at a few idiots who really code like this!!&lt;/p&gt;&lt;p&gt;And they tell everyone they know PHP!! Its sad but true. I'm going to start a site where we can blacklist these what I like to call "Cowboy Programmers" (YEEEHAAA!!!! Lets build a system in PHP!!! YEEEHAAA!!!) because they soil the job market and ruin companies with great ideas forever.&lt;/p&gt;&lt;p&gt;Also have worked on lots of projects with comments like:&lt;br&gt;//Must put search results here&lt;br&gt; - with no further code to search any database - What a joke!!&lt;/p&gt;&lt;p&gt;This is the type of stuff I used to see in "sites" built by "programmers" using ASP and Access!! ROFL!!&lt;/p&gt;&lt;p&gt;I started coding when I was 11. I taught myself from books (GW Basic). I can not relate to you guys who say your code used to look like that, sorry. So I'll just say I have never done anything so idiotic. Its just easier to write an HTML site than to try and work with that drivel!!&lt;/p&gt;&lt;p&gt;The best part is how surprised the poor site owner seems to be. LMFAO!! "Really?" - Yes. You got screwed, man! Sorry to be the bearer of bad news!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Otto</dc:creator><pubDate>Wed, 01 Oct 2008 11:33:12 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-2629675</link><description>&lt;p&gt;Oh my... and I thought my code was bad!&lt;/p&gt;&lt;p&gt;Though mine is messy and bad, it still works fine, but not as messy as that above. That just takes the p...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dale Hay</dc:creator><pubDate>Thu, 25 Sep 2008 15:00:31 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-2397876</link><description>&lt;p&gt;I wish it was just bullshit but it's not. The cleanup job is ongoing as we speak. The DB was 1.5GB at the time of writing, I don't even want to know what it is now...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Henrik</dc:creator><pubDate>Wed, 17 Sep 2008 10:24:40 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-2393091</link><description>&lt;p&gt;lol, good one. You dont see many of these related to coding its usually hardware helpdesks and some numpty that cant switch on a PC.&lt;/p&gt;&lt;p&gt;Working with someone elses code is a nightmare, especially if they really havent got a clue. I assume this was a true story? If so what size where the DB date and click logs, lol.&lt;/p&gt;&lt;p&gt;I especially like the end and those immortal words....&lt;/p&gt;&lt;p&gt;    "I need a Chang, a big one" - usually helps.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ray</dc:creator><pubDate>Tue, 16 Sep 2008 21:39:20 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494386</link><description>&lt;p&gt;@peecs&lt;/p&gt;&lt;p&gt;Thats so pretty...my favorite is:&lt;/p&gt;&lt;p&gt;// Please do not touch my code.&lt;/p&gt;&lt;p&gt;to which my answer would be:&lt;/p&gt;&lt;p&gt;thank you&lt;/p&gt;&lt;p&gt;;) But looking back, i got loads of old code thats not too pretty, probably those guys improved too.&lt;/p&gt;&lt;p&gt;Love&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">R</dc:creator><pubDate>Fri, 18 Jul 2008 04:54:19 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494385</link><description>&lt;p&gt;Say NO for digital inclusion!&lt;/p&gt;&lt;p&gt;Probably made by someone's nephew&lt;/p&gt;&lt;p&gt;lol&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Heron</dc:creator><pubDate>Thu, 10 Jul 2008 08:14:06 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494384</link><description>&lt;p&gt;Lol that was funny. &lt;br&gt;I found this snippet , pretty funny, i still try figure why to use this code when he could use pure html...&lt;/p&gt;&lt;p&gt;&amp;lt;?php&lt;br&gt;    // DYNAMIC Product list for my products.!&lt;br&gt;    // Based on the General Publci Liesencec!!!!!!!!!!!!!!!!&lt;br&gt;    // Please do not touch my code. &lt;br&gt;                                                      echo "";&lt;/p&gt;&lt;p&gt;                   echo "";&lt;/p&gt;&lt;p&gt;// DYNAMIC ARRAY OF MY TABLE HEADERS&lt;br&gt;    $array[0][key] = 0;&lt;br&gt;  $array[0][Value] = Price;&lt;br&gt;    $array[1][key] = 1;&lt;br&gt;      $array[1][Value] = ID;&lt;br&gt;  $array[2][key] = 2;&lt;br&gt;    $array[2][Value] = Name;&lt;br&gt;      $array[3][key] = 3;&lt;br&gt;    $array[3][Value] = Type;&lt;br&gt;                       $array[4][key] = 4;&lt;br&gt;    $array[4][Value] = Description;&lt;br&gt;           $array[5][key] = 5;&lt;br&gt; $array[5][Value] = Weight;&lt;br&gt;    $array[6][key] = 6;&lt;br&gt;      $array[6][Value] = Code;&lt;br&gt;          $array[7][key] = 7;&lt;br&gt;    $array[7][Value] = Product;&lt;br&gt;        $array[8][key] = 8;&lt;br&gt;    $array[8][Value] = MoneyCurrency;&lt;br&gt;          $array[9][key] = 9;&lt;br&gt;  $array[9][Value] = Paymentmethod;&lt;br&gt;                            $array[10][key] = 10;&lt;br&gt;    $array[10][Value] = PayPal;&lt;/p&gt;&lt;p&gt;if ($array[10][Value] == PayPal){&lt;/p&gt;&lt;p&gt;                function addPayPal(){&lt;br&gt;                    return "PAYPAL OK";&lt;br&gt;                }&lt;br&gt;}&lt;/p&gt;&lt;p&gt;echo "&lt;/p&gt;&lt;p&gt;    (ID: $array[0][key])-$array[0][value]&lt;br&gt;    (ID: $array[1][key])-$array[1][value]&lt;br&gt;    (ID: $array[2][key])-$array[2][value]&lt;br&gt;    (ID: $array[3][key])-$array[3][value]&lt;br&gt;    (ID: $array[4][key])-$array[4][value]&lt;br&gt;    (ID: $array[5][key])-$array[5][value]&lt;br&gt;    (ID: $array[6][key])-$array[6][value]&lt;br&gt;    (ID: $array[7][key])-$array[7][value]&lt;br&gt;    (ID: $array[8][key])-$array[8][value]&lt;br&gt;    (ID: $array[9][key])-$array[9][value]&lt;br&gt;    (ID: $array[10][key])-$array[10][value]&lt;/p&gt;&lt;p&gt;";&lt;/p&gt;&lt;p&gt;/*&lt;/p&gt;&lt;p&gt; TODO: Put in the list of items here in table tags&lt;br&gt;*/&lt;/p&gt;&lt;p&gt;echo "";&lt;/p&gt;&lt;p&gt; echo "";&lt;/p&gt;&lt;p&gt;?&amp;gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Peec</dc:creator><pubDate>Thu, 29 May 2008 05:49:02 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494383</link><description>&lt;p&gt;GNUb: Interesting observation, I'll definitely check this out. If you're right then these two softwares are doing a lot of damage on an incalculable scale.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Henrik</dc:creator><pubDate>Fri, 28 Mar 2008 09:17:28 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494382</link><description>&lt;p&gt;Oh. My. God.&lt;/p&gt;&lt;p&gt;I feel for you guys. It makes me glad I get to go back over some of my awful coding mistakes on routine code rewrite cycles!&lt;/p&gt;&lt;p&gt;The issue is there's no minimum barrier of entry for PHP - anyone can use it, including noobs. It doesn't punish you for bad coding habits, like - say - java.&lt;/p&gt;&lt;p&gt;Thanks for sharing this. You made me feel much better about the 'bad smells' in my own code =)&lt;/p&gt;&lt;p&gt;Jan&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jan</dc:creator><pubDate>Sun, 16 Mar 2008 03:41:01 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494381</link><description>&lt;p&gt;Actually, this looks like a cut-and-paste from Dreamweaver or Frontpage code. Try it in DW/FP and you'll see similar code being generated.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">GNUb</dc:creator><pubDate>Sat, 15 Mar 2008 13:58:08 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494372</link><description>&lt;p&gt;I had to work with PHP code from a "system administrator". He place echo = ""; on every single line :|&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">localjoost</dc:creator><pubDate>Tue, 11 Mar 2008 06:42:18 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494369</link><description>&lt;p&gt;wow.. this code really smells.. my first tries with php were better than this (it still sucked but not as much as this)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">kane77</dc:creator><pubDate>Sun, 09 Mar 2008 07:56:51 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494370</link><description>&lt;p&gt;What a hell is that noob code ????&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hugo</dc:creator><pubDate>Thu, 28 Feb 2008 17:02:42 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494371</link><description>&lt;p&gt;k3vin: Still you were better than this, even in 8th grade. This is a grown up man's work, a professional, he got paid to do this.&lt;/p&gt;&lt;p&gt;I mean the equivalent in the "real world" would be if for instance a plumber installs a lot of piping in your house and it all works to begin with. After awhile though all hell breaks loose and your house ends up flooded. It's nothing less than a scam that you can sue for. And this should not be any different.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Henrik</dc:creator><pubDate>Thu, 28 Feb 2008 08:14:44 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494373</link><description>&lt;p&gt;The sad thing is that my code used to look somewhat like that 5 years ago. Given, that I was in 8th grade.. and it was for a personal website. And I knew what a loop was. Okay, maybe even then it was slightly better but I have to say that I had had HTML being echoed all over the place.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">k3vin</dc:creator><pubDate>Tue, 26 Feb 2008 19:34:48 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494380</link><description>&lt;p&gt;Sometimes big companies have projects with such 'worst code'. Yes, it's bad, but they can't pay for rewriting it from scratch while it's working.&lt;/p&gt;&lt;p&gt;Then they need our companies to support such code -- We dislike bad code too but we work on it for money. $20 hourly.&lt;br&gt;&lt;a href="http://www.kauroff.com" rel="nofollow noopener" target="_blank" title="www.kauroff.com"&gt;www.kauroff.com&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eugene</dc:creator><pubDate>Tue, 26 Feb 2008 17:55:53 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494379</link><description>&lt;p&gt;After reading the first lines of code, I could not help myself.....&lt;/p&gt;&lt;p&gt;if($controlip == ""){ &lt;br&gt; echo"&lt;b&gt;Sie ?bertragen an unser System keine IP-Adresse und haben damit leider nicht die Rechte sich diese Seiten anzusehen!&lt;/b&gt;"; &lt;br&gt;}else{ &lt;br&gt;  function func_header($text = "") &lt;br&gt;  { &lt;br&gt;    echo "&lt;b&gt;$text&lt;/b&gt;"; &lt;br&gt;  } &lt;br&gt;if($goon == "logout") &lt;br&gt;{ &lt;br&gt;$ask= "UPDATE `adminuser` SET logintime=logintime-3600 WHERE `adminuser`='$adminuser'"; &lt;br&gt;$result = mysql_query($ask) or die(mysql_error());&lt;/p&gt;&lt;p&gt;The function really got to me..............lmfao.............&lt;/p&gt;&lt;p&gt;thanks for this man........loved it.....&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ronald</dc:creator><pubDate>Tue, 26 Feb 2008 11:28:07 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494378</link><description>&lt;p&gt;Anonymous: Ouch! I feel with you man, that sounds excruciating :(  In fact I will hand it to you, THAT is the world's worst PHP code, not mine. I wish you good luck poor brave soul, you have my deepest sympathies.&lt;/p&gt;&lt;p&gt;K: I have seen OS Commerce and it doesn't put it to shame but it's not pretty either that I can agree with you on!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Henrik</dc:creator><pubDate>Mon, 25 Feb 2008 21:13:59 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494377</link><description>&lt;p&gt;WOW, that is the best shit i have ever seen! Very classic guys! I feel bad for you!! I love the $ask, $ask1, $ask2 and so on!! LOL WOW!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Greg Winn</dc:creator><pubDate>Mon, 25 Feb 2008 20:09:34 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494376</link><description>&lt;p&gt;Trying to post this anonymous for obvious reasons.  The PHP website I work for is far worse than that.  Imagine taking that code as it is:&lt;br&gt;* styles all embedded in html. really no CSS whatsoever&lt;br&gt;* queries embedded directly in pages, copy-pasted to multiple places&lt;/p&gt;&lt;p&gt;Add in:&lt;br&gt;* the site uses frames.  extensively :(&lt;br&gt;* payments, for instance, were reimplemented in a dozen or so places using copy-paste.  bugs were often fixed in only one place, or fixed in different ways in different places.&lt;/p&gt;&lt;p&gt;The worst though - there were no 'echo' statements for printing HTML.  The previous developers figured out echo statements were bad.  Now hear what their solution was:&lt;/p&gt;&lt;p&gt;For every echo statement, they moved the html into a text .inc file and included it from the php page.  These .inc files were strictly HTML only, and named with seemingly random abbrevations, eg. &lt;a href="http://index_a.inc" rel="nofollow noopener" target="_blank" title="index_a.inc"&gt;index_a.inc&lt;/a&gt;, &lt;a href="http://index_qp.inc" rel="nofollow noopener" target="_blank" title="index_qp.inc"&gt;index_qp.inc&lt;/a&gt;, &lt;a href="http://index_lj.inc" rel="nofollow noopener" target="_blank" title="index_lj.inc"&gt;index_lj.inc&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;You may be wondering, "How did they handle things like looped HTML tables?"&lt;/p&gt;&lt;p&gt;By putting every line in its own file.  There was a .inc file for the begin table tag.  A separate file for the end table tag.  A separate file for the TR begin tag, and a separate file for the TR end tag.  Another file for each TD that had to be looped on.  Rinse and repeat for every single page in this rather large website.&lt;/p&gt;&lt;p&gt;And this is now the my "baby" along with the rest of the dev team.  Most of our time is taken up with maintenance and bugfixes, and projects require hard decisions on how much to rewrite.  That's a very hard decision - Do we have time to rewrite X, or do we need to continue implementing some of this new project using X, which is horrendous and horribly broken?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Mon, 25 Feb 2008 16:59:31 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494375</link><description>&lt;p&gt;conditions without "typing" methods called inside conditions, defineless code , what's that mess ?&lt;/p&gt;&lt;p&gt;choose life drop the if :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bdm</dc:creator><pubDate>Mon, 25 Feb 2008 13:28:31 -0000</pubDate></item><item><title>Re: The worst PHP code in the world</title><link>http://www.prodevtips.com/2008/02/25/the-worst-php-code-in-the-world/#comment-1494374</link><description>&lt;p&gt;Take a look at OS Commerce.  It puts that to shame, plus it is insecure.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">K</dc:creator><pubDate>Mon, 25 Feb 2008 12:16:55 -0000</pubDate></item></channel></rss>