<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: The daily WTF Greatest Hits II</title>
	<atom:link href="http://www.jorgebernal.info/wtf/the-daily-wtf-greatest-hits-ii/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jorgebernal.info/wtf/the-daily-wtf-greatest-hits-ii</link>
	<description></description>
	<lastBuildDate>Tue, 09 Mar 2010 14:28:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: DidieR</title>
		<link>http://www.jorgebernal.info/wtf/the-daily-wtf-greatest-hits-ii/comment-page-1#comment-72</link>
		<dc:creator>DidieR</dc:creator>
		<pubDate>Tue, 25 Apr 2006 06:26:38 +0000</pubDate>
		<guid isPermaLink="false">#comment-72</guid>
		<description>Ouh... &quot;Les grands esprits se rencontrent&quot;...

In fact, this is pretty stupid. I don&#039;t hack much.. But I see that this is stupid though...</description>
		<content:encoded><![CDATA[<p>Ouh&#8230; &#8220;Les grands esprits se rencontrent&#8221;&#8230;</p>
<p>In fact, this is pretty stupid. I don&#8217;t hack much.. But I see that this is stupid though&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raphink</title>
		<link>http://www.jorgebernal.info/wtf/the-daily-wtf-greatest-hits-ii/comment-page-1#comment-71</link>
		<dc:creator>Raphink</dc:creator>
		<pubDate>Fri, 14 Apr 2006 02:04:54 +0000</pubDate>
		<guid isPermaLink="false">#comment-71</guid>
		<description>Wow that is really stupid indeed!
Would be faster to just print the db url, user, and passwd on the website if this guy wants his db to be borked :D</description>
		<content:encoded><![CDATA[<p>Wow that is really stupid indeed!<br />
Would be faster to just print the db url, user, and passwd on the website if this guy wants his db to be borked <img src='http://www.jorgebernal.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: koke</title>
		<link>http://www.jorgebernal.info/wtf/the-daily-wtf-greatest-hits-ii/comment-page-1#comment-70</link>
		<dc:creator>koke</dc:creator>
		<pubDate>Thu, 13 Apr 2006 04:19:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-70</guid>
		<description>&lt;p&gt;This one is definitely winning my personal contest of worst code piece ever by now:&lt;/p&gt;


&lt;code&gt;&lt;pre&gt;
function saveform()
{
  var firstName = escapeSql(mainForm.elements.txtFirstName.value);
  var lastName = escapeSql(mainForm.elements.txtLastName.value);
  /* ... */
  var offerCode = escapeSql(mainForm.elements.txtOfferCode.value);

  var code =
  &#039;  $cn = mssql_connect($DB_SERVER, $DB_USERNAME, $DB_PASSWORD)           &#039; +
  &#039;          or die(&quot;ERROR: Cannot Connect to $DB_SERVER&quot;);                &#039; +
  &#039;  $db = mssql_select_db($DB_NAME, $cn);                                 &#039; +
  &#039;                                                                        &#039; +
  &#039;  if (mssql_query(&quot;SELECT 1 FROM APPS WHERE SSN=\&#039;&#039;+ssn+&#039;\&#039;&quot;, $cn)) &#039; +
  &#039;  { $ins = false; }                                                     &#039; +
  &#039;  else                                                                  &#039; +
  &#039;  { $ins = true; }                                                      &#039; +
  &#039;                                                                        &#039; +
  &#039;  if ($ins) {                                                           &#039; +
  &#039;    $sql = &quot;INSERT INTO APPS (FIRSTNM, LASTNM, ..., OFFERCD) VALUES (&quot;; &#039; +
  &#039;    $sql+= &quot;\&#039;&#039;+firstName+&#039;\&#039;,&quot;;                                        &#039; +
  &#039;    $sql+= &quot;\&#039;&#039;+lastName+&#039;\&#039;,&quot;;                                         &#039; +
  &#039;    $sql+= &quot;\&#039;&#039;+offerCode+&#039;\&#039;)&quot;;                                        &#039; +
  &#039;                                                                        &#039; +
  &#039;  /* ... */                                                             &#039; +
  &#039;                                                                        &#039; +
  &#039;  mssql_query($sql, $cn);                                               &#039; +
  &#039;  mssql_close($cn);                                                     &#039;;

  execPhp(code);
}
&lt;/pre&gt;&lt;/code&gt;

	&lt;p&gt;I wonder who&#8217;d kill who if someone saves the &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; code and changes $sql to &lt;code&gt;DELETE FROM APPS&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;Via &lt;a href=&quot;http://www.thedailywtf.com/forums/68115/ShowPost.aspx&quot;&gt;Client-side &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>This one is definitely winning my personal contest of worst code piece ever by now:</p>
<p><code>
<pre>
function saveform()
{
  var firstName = escapeSql(mainForm.elements.txtFirstName.value);
  var lastName = escapeSql(mainForm.elements.txtLastName.value);
  /* ... */
  var offerCode = escapeSql(mainForm.elements.txtOfferCode.value);

  var code =
  '  $cn = mssql_connect($DB_SERVER, $DB_USERNAME, $DB_PASSWORD)           ' +
  '          or die("ERROR: Cannot Connect to $DB_SERVER");                ' +
  '  $db = mssql_select_db($DB_NAME, $cn);                                 ' +
  '                                                                        ' +
  '  if (mssql_query("SELECT 1 FROM APPS WHERE SSN=\''+ssn+'\'", $cn)) ' +
  '  { $ins = false; }                                                     ' +
  '  else                                                                  ' +
  '  { $ins = true; }                                                      ' +
  '                                                                        ' +
  '  if ($ins) {                                                           ' +
  '    $sql = "INSERT INTO APPS (FIRSTNM, LASTNM, ..., OFFERCD) VALUES ("; ' +
  '    $sql+= "\''+firstName+'\',";                                        ' +
  '    $sql+= "\''+lastName+'\',";                                         ' +
  '    $sql+= "\''+offerCode+'\')";                                        ' +
  '                                                                        ' +
  '  /* ... */                                                             ' +
  '                                                                        ' +
  '  mssql_query($sql, $cn);                                               ' +
  '  mssql_close($cn);                                                     ';

  execPhp(code);
}
</pre>
<p></code></p>
<p>I wonder who&#8217;d kill who if someone saves the <span class="caps">HTML</span> code and changes $sql to <code>DELETE FROM APPS</code>.</p>
<p>Via <a href="http://www.thedailywtf.com/forums/68115/ShowPost.aspx">Client-side <span class="caps">PHP</span></a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
