<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Doing My Best... a Web Developers Blog &#187; Web Development</title>
	<atom:link href="http://www.iwilldomybest.com/category/webdev/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iwilldomybest.com</link>
	<description>Ranging from PHP &#38; MySQL to Random Crap from the internet, I got it all here.</description>
	<lastBuildDate>Sun, 31 Jan 2010 01:46:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>PHP Tip: Handling Form Data</title>
		<link>http://www.iwilldomybest.com/2010/01/php-tip-handling-form-data/</link>
		<comments>http://www.iwilldomybest.com/2010/01/php-tip-handling-form-data/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 01:45:41 +0000</pubDate>
		<dc:creator>dschreck</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.iwilldomybest.com/?p=94</guid>
		<description><![CDATA[One of the most common tasks of a Web Dev, has down, is handling form data. As a web developer you'll create hundreds of forms and in turn, write hundreds of pieces of code to handle your form data. Early on this became the worse part of my job. So I've create a super quick [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most common tasks of a Web Dev, has down, is handling form data. As a web developer you'll create hundreds of forms and in turn, write hundreds of pieces of code to handle your form data.<br />
<span id="more-94"></span><br />
Early on this became the worse part of my job. So I've create a super quick way to handle post data:</p>
<pre>

$valid = true; //innocent until proven guilty
$errors = array(); // errors array
$clean = array();

foreach($_POST as $key => $val)
{
	switch($key)
	{
		case 'first_name':
			// do validation
			if(validateString($val) == false)
			{
				$valid = false; // we're no longer valid.
				$errors[] = "You're missing your first name!"; // prime up an error message for our user
			}
			else
			{
				$clean[$key] = $val;
			}
			break;
		case 'last_name':
			// do validation
			break;
	}
}

if($valid == false)
{
	// show the form again, but with the error message
}
else
{
	// handle our clean array anyway we want (usually a DB insert)
}

?>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.iwilldomybest.com/2010/01/php-tip-handling-form-data/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Q&amp;A: Which Framework Should I Use?</title>
		<link>http://www.iwilldomybest.com/2009/09/qa-which-framework-should-i-use/</link>
		<comments>http://www.iwilldomybest.com/2009/09/qa-which-framework-should-i-use/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 11:31:40 +0000</pubDate>
		<dc:creator>dschreck</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.iwilldomybest.com/?p=92</guid>
		<description><![CDATA[Q: Which Framework Should I Use to make &#60;blank&#62; ? A: You're already off on the wrong foot. The reason? You're thinking you need a framework to get whatever you need done. All too often I see posts on forums or on IRC: "What framework should I use for a large networking site, like MySpace?" [...]]]></description>
			<content:encoded><![CDATA[<p>Q: Which Framework Should I Use to make &lt;blank&gt; ?</p>
<p>A: You're already off on the wrong foot. The reason? You're thinking you need a framework to get whatever you need done.<br />
<span id="more-92"></span><br />
All too often I see posts on forums or on IRC: "What framework should I use for a large networking site, like MySpace?"</p>
<p>1) Comon, MySpace? Ugh.</p>
<p>2) If you have to ask, you're doing it wrong.</p>
<p>3) This question will spawn a thread of everyone promoting their own personal frameworks. E-Peen war ensues.</p>
<p>You're asking the wrong question. Some better questions might be:<br />
"Is there a particular framework that out performs another?"<br />
"How is performance gauged?"<br />
"Does it allow Master to Slave databases?"<br />
"Does it support Memcache?"<br />
"What kind of templating system does it use?"<br />
"What's the ease of development?"</p>
<p>As you drill further and further down into these questions, you're going to discover you will have to start making comprimises.</p>
<p>Some frameworks eat up less CPU, but does that mean it out performs?<br />
For a large "networking site" you'll need hundreds of database servers, so really, does any framework handle that many "out of the box" ?<br />
If you go, "Memcache - what's that?" - then you're already set up for fail. If you find a framework that does support clusters of MC servers, will it allow you to tailor it to your needs?<br />
As far as templating systems go, generic Smarty won't cut it. You'll need to hack, strip and extend Smarty into all sorts of weird specific configurations for optimal performance.<br />
Ease of development? Does it work well for you? How long will it take to hack your framework into a better performing set up? How much effort goes into training new devs on the project?</p>
<p>You're going to find yourself coming to a realization: You need to put in a lot of work.</p>
<p>Reaching out for a framework is a common misconception of Jr Developers. It's easy to grab for these frameworks beacuse you don't really understand what they do.</p>
<p>Don't get me wrong, some of the frameworks out there are great. And not every project requires custom built frameworks.</p>
<p>But there's two different leagues here. While you're playing in the minors - have fun with your frameworks, use Zend, CI, Symphony, what have you.</p>
<p>When it comes time to play in the big leagues, leave your AA and AAA crap at the door.</p>
<p>There's a difference between sites that serve 1 M Unique users a month, and those that serve over 10 M unique users a day, and that difference is not found in a box, or "off the shelve."</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iwilldomybest.com/2009/09/qa-which-framework-should-i-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modrewrite and Short Urls &#8211; What you really want to know.</title>
		<link>http://www.iwilldomybest.com/2009/01/modrewrite-and-short-urls-htaccess-file-tip/</link>
		<comments>http://www.iwilldomybest.com/2009/01/modrewrite-and-short-urls-htaccess-file-tip/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 11:07:44 +0000</pubDate>
		<dc:creator>dschreck</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mod rewrite]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://www.iwilldomybest.com/?p=77</guid>
		<description><![CDATA[I recently opened up an old .htaccess and I was struck with the memory of how much it sucked trying to Google search for some real, working, answers on making short urls. So here you go, my quick tip on what you really want to know about mod_rewrite. If you want an actual explanation of [...]]]></description>
			<content:encoded><![CDATA[<p>I recently opened up an old <a title="WikiPedia - Htaccess" href="http://en.wikipedia.org/wiki/Htaccess" target="_blank">.htaccess</a> and I was struck with the memory of how much it sucked trying to Google search for some real, working, answers on making short urls.</p>
<p>So here you go, my quick tip on what you really want to know about <a title="ApacheDocs - Mod_rewrite" href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html" target="_blank">mod_rewrite</a>.</p>
<p><span id="more-77"></span></p>
<p>If you want an actual explanation of what is going on here it's at the bottom.</p>
<p><strong>Solution 1:</strong></p>
<p><code>File: .htaccess</code></p>
<pre>Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+) /index.php [L]</pre>
<p><code>File: index.php</code><br />
<code><br />
&lt;?php<br />
$urlArray = explode("/",$_SERVER['REQUEST_URI']);<br />
array_shift($urlArray); // Gets rid of the blank first param.<br />
?&gt;<br />
</code></p>
<p>Now you have an array with all of your parts, and you can map them accordingly.</p>
<p><strong>Solution 1.a (more elegant):</strong><br />
<code>File: .htaccess</code></p>
<pre>&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt;/IfModule&gt;</pre>
<p>That version just checks to make sure the module is installed.</p>
<p><strong>Solution 2:</strong><br />
If you have just a couple of pages that you want to look prettier:</p>
<p><code>File: .htaccess</code></p>
<pre>Options +FollowSymLinks
RewriteEngine on
RewriteRule ^home$ index.php
RewriteRule ^about$ about.php</pre>
<p>And you just keep adding <code>RewriteRule</code>'s for each page. This is really only helpful when you just have a set of static looking pages for a site.</p>
<p><strong>Explanation:</strong></p>
<dl>
<dt>Options +FollowSymLinks</dt>
<dd>Tells Apache to follow sym links (usually on anyways...)</dd>
<dt>RewriteEngine on</dt>
<dd>Tells apache to turn on the RewriteEngine for this folder</dd>
<dt>RewriteCond %{REQUEST_FILENAME} !-f</dt>
<dd>Read this as: Condtion, If the file we're requesting is not a file...</dd>
<dt>RewriteCond %{REQUEST_FILENAME} !-d</dt>
<dd>Read this as: Condtion, If the file we're requesting is not a directory...</dd>
<dt>RewriteRule . /index.php [L]</dt>
<dd>Then Rewrite this url to index.php ([L] forces it to be the last redirect)</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://www.iwilldomybest.com/2009/01/modrewrite-and-short-urls-htaccess-file-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Professional PHP</title>
		<link>http://www.iwilldomybest.com/2009/01/professional-php/</link>
		<comments>http://www.iwilldomybest.com/2009/01/professional-php/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 16:05:18 +0000</pubDate>
		<dc:creator>dschreck</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.iwilldomybest.com/?p=61</guid>
		<description><![CDATA[It's important to remember what sets a professional PHP developer apart from the pack that floods your average help channel. Too often I run into reviewing or helping a "professional" developer, and I can't help but mutter "you're doing it wrong..." I feel the most important attribute that separates one developer from another is when [...]]]></description>
			<content:encoded><![CDATA[<p>It's important to remember what sets a professional PHP developer apart from the pack that floods your average help channel.</p>
<p>Too often I run into reviewing or helping a "professional" developer, and I can't help but mutter "you're doing it wrong..."</p>
<p><span id="more-61"></span></p>
<p>I feel the most important attribute that separates one developer from another is when they write for usability and maintainability.</p>
<p>So let's take a look at some extremely simple steps you can take to make your project's code more flexible.</p>
<p>1. For the love of all that there is, seperate your header and footer files. Yes, I'm still seeing this happen, often. All content that is above your generated page needs to go into a header file, and all the content below it into a footer file. So when you need to modify one line, you do it only once.</p>
<pre>&lt;?php
require_once(dirname(__FILE__).'/includes/header.php');
?&gt;
&lt;div id='content'&gt;
&lt;?php
	// script runs
?&gt;
&lt;/div&gt;
&lt;?php
require_once(dirname(__FILE__).'/includes/footer.php');
?&gt;</pre>
<p>2. Create a function to generate your navigation. And when I say generate, I mean you give it some flexibility as well. This can be done even with the smallest of sites. Example:</p>
<pre>&lt;?php
$site_pages = array();
$site_pages[] = array('text' =&gt; 'home', 'link' =&gt; 'home.php');
$site_pages[] = array('text' =&gt; 'about', 'link' =&gt; 'about.php');
$site_pages[] = array('text' =&gt; 'partner', 'link' =&gt; 'http://www.example.domain.com/');

function buildNav($links)
{
	$output = '';
	foreach($links as $page)
	{
		$output .= "&lt;a href=\"{$page['link']}\" title=\"{$page['text']}\"&gt;{$page['text']}&lt;/a&gt;\n";
	}
 	return $output;
}
?&gt;</pre>
<p>The example above could easily be modified to allow optional values to the array, like <code>'enabled' =&gt; false</code> to turn off a link. Or you could define a link "template", and use <code>str_replace()</code> to substitute values.</p>
<p>This means if you, or the customer (with any know how) can quickly update the links at any time. For more advanced sites/projects this can obviously become more complicated, but it saves even more time.</p>
<p>3. If you're not going to use OOP, at least use functions. Any common task or specific sequence should be placed in it's own function. An example would be our navigation function from #2. Another example would be running a query for a specific item. If you ever need to modify your table structure you'll regret having to hunt down all of your inline queries.</p>
<p>4. When you create 'admin' features, take the 5 minutes to create a function that actually checks if the person accessing that "super hidden" directory filled with scripts that just accept anything.</p>
<p>I've seen this happen even on large global community sites.</p>
<p>Some developers will stuff their admin scripts in a folder such as /admin/, and just assume that if data is posted there then it's ok.</p>
<p>The least you should do is place a session check, and place it in a function.</p>
<pre>&lt;?php
function isAdmin()
{
	if(!isset($_SESSION['user_name']) || !isset($_SESSION['user_id']))
	{
		return false;
	}
	else
	{
		$sql = "SELECT COUNT(*) as cnt FROM user_table WHERE user_id = ".intval($_SESSION['user_id']);
		// do the query, check it, etc.
		return true;
	}
}
?&gt;</pre>
<p>Then when it comes time to run your script, simply:</p>
<pre>&lt;?php
if(isAdmin() === false)
{
	die('Log back in');
}
?&gt;</pre>
<p>5. Create a wrapper for handling escape strings. If you're not using a database class (like PDO) to handle this, you'll need to do this.</p>
<p>Just assume that your client could have their PHP configuration change, or they change hosts, or any possible combination of changes take place.</p>
<p>Create a simple wrapper that will check of magic quotes, and escape for your database insert.</p>
<pre>&lt;?php
function cleanString($input)
{
	if(get_magic_quotes_gpc())
	{
		$input = stripslashes($input);
	}
	$output = mysql_real_escape_string(trim($input));

	return $output;
}
?&gt;</pre>
<p>6. Create a configuration file so you can update common yet critical variables. An example of this would be paths. Your system quickly gains adaptability if you just create a defines.php file, and place in there your simple variables.</p>
<p>The overall approach you should have to any project you take is that you should use an establish tool chain you have developed. It doesn't take much time or effort to create a simple set of classes that can handle just about any thing you need to create. If you wish to use functions, you can do the same. The idea is that you write once, and write it in such a manner that you can tweak it later on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iwilldomybest.com/2009/01/professional-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Speaks on Net Neutrality and Benefits of caching</title>
		<link>http://www.iwilldomybest.com/2008/12/google-speaks-on-net-neutrality-and-benefits-of-caching/</link>
		<comments>http://www.iwilldomybest.com/2008/12/google-speaks-on-net-neutrality-and-benefits-of-caching/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 04:15:13 +0000</pubDate>
		<dc:creator>dschreck</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[edge]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[net]]></category>
		<category><![CDATA[neutrality]]></category>

		<guid isPermaLink="false">http://www.iwilldomybest.com/?p=69</guid>
		<description><![CDATA[In this post on the google blog,http://googleblog.blogspot.com/2008/12/net-neutrality-and-benefits-of-caching.html , Google speaks about how people are confused on the net neutrality and the use of edge caching. I find it interesting that someone could take the usage of CDN's as an act of an un neutral  web. The act of handling certain traffic as more important than [...]]]></description>
			<content:encoded><![CDATA[<p>In this post on the google blog,<a title="http://googleblog.blogspot.com/2008/12/net-neutrality-and-benefits-of-caching.html" href="http://googleblog.blogspot.com/2008/12/net-neutrality-and-benefits-of-caching.html" target="_blank">http://googleblog.blogspot.com/2008/12/net-neutrality-and-benefits-of-caching.html</a> , Google speaks about how people are confused on the net neutrality and the use of edge caching.</p>
<p>I find it interesting that someone could take the usage of CDN's as an act of an un neutral  web.</p>
<p>The act of handling certain traffic as more important than other traffic is the act of an un neutral web. Developers should consider these words carefully.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iwilldomybest.com/2008/12/google-speaks-on-net-neutrality-and-benefits-of-caching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screen Scraping made too easy</title>
		<link>http://www.iwilldomybest.com/2008/12/screen-scraping-made-too-easy/</link>
		<comments>http://www.iwilldomybest.com/2008/12/screen-scraping-made-too-easy/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 08:40:27 +0000</pubDate>
		<dc:creator>dschreck</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[screen scrape]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.iwilldomybest.com/?p=63</guid>
		<description><![CDATA[Recently I had some free time and I decided I wanted to automate some common tasks of mine. And let me tell you honestly, I hate having to do screen scraping. It's an annoying, tedious task. Making regex for this, and for that, and then to find out my hours were wasted as that regex [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had some free time and I decided I wanted to <a title="WikiPedia - Automation" href="http://en.wikipedia.org/wiki/Automation" target="_blank">automate</a> some common tasks of mine. And let me tell you honestly, I hate having to do screen scraping. It's an annoying, tedious task. Making regex for this, and for that, and then to find out my hours were wasted as that regex won't work on another site.</p>
<p>That's a thing of the past.</p>
<p><span id="more-63"></span></p>
<p>I'm super excited about this find. Maybe I'm the last to discover it, but it's just too awesome to pass up.</p>
<p>The project is called: <a title="PHP Simple HTML DOM Parser" href="http://simplehtmldom.sourceforge.net/" target="_blank">PHP Simple HTML DOM Parser</a>.</p>
<p>Literally, this takes almost all of the magic out of screen scraping. Here's an example from a quick and dirty login and grab my stats for <a title="e-Sports Entertainment" href="http://esportsea.com" target="_blank">ESEA</a>.</p>
<pre>require_once('simple_html_dom.php'); // get our class

define('COOKIE_JAR','./cookie/cookie'); // cookie jar for cURL
/**
* We need to set up our referrer and user agent, for cURL
**/
$referrer = "http://www.esportsea.com/";
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4";
/**
* str = our direct link to our user page
**/
$str = "http://www.esportsea.com/users/&lt;your user id&gt;";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$str);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_REFERER, $referrer);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_COOKIEFILE, COOKIE_JAR);
curl_setopt($ch, CURLOPT_COOKIEJAR, COOKIE_JAR);
curl_setopt($ch, CURLOPT_TIMEOUT, '10');
$result = curl_exec ($ch);
curl_close ($ch);
// done with cURL
$html = new simple_html_dom(); // create our HTML object

$html-&gt;load($result);

$pug_stats = $html-&gt;find('#body-matches-pug table tr'); // load up pug stats

// this loops through each &lt;tr&gt;
$output = array();
foreach($pug_stats as $stat)
{
	$row['game'] 	= trim($stat-&gt;find('img',0)-&gt;title);
	$row['link'] 	= trim($stat-&gt;find('a',0)-&gt;href);
	$row['score']	= trim($stat-&gt;find('a',0)-&gt;plaintext);
	$row['srv'] 	= trim($stat-&gt;find('a',1)-&gt;href);
	$row['srv_txt'] = trim($stat-&gt;find('a',1)-&gt;plaintext);
	$output[] = $row;

}
echo "&lt;pre&gt;",print_r($output,true),"&lt;/pre&gt;";
exit;

?&gt;</pre>
<p>And that's it.</p>
<p>Now take a look at that, and realize how much stuff I'm not forced to do.</p>
<p>I know this isn't some great new invention, loading the source into a DOM object and parsing it, but man, this almost eliminates the need to think about screen scraping entirely.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iwilldomybest.com/2008/12/screen-scraping-made-too-easy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Search Engine Spam Videos</title>
		<link>http://www.iwilldomybest.com/2008/10/search-engine-spam-videos/</link>
		<comments>http://www.iwilldomybest.com/2008/10/search-engine-spam-videos/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 18:33:41 +0000</pubDate>
		<dc:creator>dschreck</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[protect]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.iwilldomybest.com/?p=59</guid>
		<description><![CDATA[Some some tweets come in and I headed on over to IM Broadcast saw some Search Engine Spam videos come up. I thought they were pretty interesting to watch, and it was nice to hear from MSN, Google, and Yahoo. It does make me wonder if black hat SEO really does have a chance? Anyways, [...]]]></description>
			<content:encoded><![CDATA[<p>Some some <a title="My Twitter" href="http://www.twitter.com/dschreck" target="_blank">tweets</a> come in and I headed on over to <a title="IM Broadcast" href="http://www.imbroadcast.com" target="_blank">IM Broadcast</a> saw some Search Engine Spam videos come up.</p>
<p>I thought they were pretty interesting to watch, and it was nice to hear from MSN, Google, and Yahoo. It does make me wonder if black hat SEO really does have a chance? <img src='http://www.iwilldomybest.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> </p>
<p>Anyways, here are the direct links to the vids:</p>
<p><a title="Part One" href="http://www.imbroadcast.com/video/53/Search-Engine-Spam-Part-1-Overview" target="_blank">http://www.imbroadcast.com/video/53/Search-Engine-Spam-Part-1-Overview</a></p>
<p><a title="Part Two" href="http://www.imbroadcast.com/video/55/Search-Engine-Spam-Part-2-On-The-Page-Issues" target="_blank">http://www.imbroadcast.com/video/55/Search-Engine-Spam-Part-2-On-The-Page-Issues</a></p>
<p><a title="Part Three" href="http://www.imbroadcast.com/video/54/Search-Engine-Spam-Part-3-Link-Spam--Paid-Links" target="_blank">http://www.imbroadcast.com/video/54/Search-Engine-Spam-Part-3-Link-Spam--Paid-Links</a></p>
<p>Hope you all enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iwilldomybest.com/2008/10/search-engine-spam-videos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Reference Card &#8211; Failed?</title>
		<link>http://www.iwilldomybest.com/2008/10/php-reference-card-failed/</link>
		<comments>http://www.iwilldomybest.com/2008/10/php-reference-card-failed/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 17:48:49 +0000</pubDate>
		<dc:creator>dschreck</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ref card]]></category>
		<category><![CDATA[reference card]]></category>

		<guid isPermaLink="false">http://www.iwilldomybest.com/?p=53</guid>
		<description><![CDATA[While taking a look at my 'Tech Blogs' tab in NetVibes I saw the headline for a reference card available for PHP. So, I hopped on over to dZone.com, got an account (it's free), and downloaded it. I'm not really impressed. I believe the beginner may benefit from this, but there's just so many gaping [...]]]></description>
			<content:encoded><![CDATA[<p>While taking a look at my 'Tech Blogs' tab in <a title="NetVibes" href="http://www.netvibes.com/" target="_blank">NetVibes</a> I saw the headline for a <a title="http://refcardz.dzone.com/refcardz/php?oid=ban00022-15" href="http://refcardz.dzone.com/refcardz/php?oid=ban00022-15" target="_blank">reference card available</a> for PHP. So, I hopped on over to dZone.com, got an account (it's free), and downloaded it.</p>
<p>I'm not really impressed.</p>
<p>I believe the beginner may benefit from this, but there's just so many gaping holes in the reference card... Like what about the GD library? Or perhaps cURL? File handling? XML?</p>
<p>Honestly, how could you call a reference card a PHP Reference Card without the most common uses listed? I think the card may be off to a good start, but please, release a new more complete version soon.</p>
<p>Final Verdict:</p>
<p>While it may be great for beginners, it's still lacking for the rest of us. I'll pass and keep php.net as my reference card.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iwilldomybest.com/2008/10/php-reference-card-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Work that DOM</title>
		<link>http://www.iwilldomybest.com/2008/08/work-that-dom/</link>
		<comments>http://www.iwilldomybest.com/2008/08/work-that-dom/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 19:59:25 +0000</pubDate>
		<dc:creator>dschreck</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[DOM]]></category>

		<guid isPermaLink="false">http://www.iwilldomybest.com/2008/08/18/work-that-dom/</guid>
		<description><![CDATA[Just real quick, this came up in #javascript the other day. Working with the DOM, appending new elements. Here's the basic idea. You have your DOM, and with JavaScript, there are ways to manipulate nodes. Including adding new ones. When you want to add new elements to your DOM, you have to think about this [...]]]></description>
			<content:encoded><![CDATA[<p>Just real quick, this came up in <a title="#JavaScript on IRC.GAMESURGE.NET" href="irc://irc.gamesurge.net/javascript" target="_blank">#javascript</a> the other day. Working with the DOM, appending new elements.</p>
<p><span id="more-19"></span></p>
<p>Here's the basic idea.</p>
<p>You have your <a title="http://en.wikipedia.org/wiki/Document_Object_Model" href="http://en.wikipedia.org/wiki/Document_Object_Model" target="_blank">DOM</a>, and with JavaScript, there are ways to manipulate nodes. Including adding new ones.  When you want to add new elements to your DOM, you have to think about this in a few different steps.</p>
<p><strong>First step, where am I placing this?</strong><br />
The reason for this is because you have to select an element to append your new element to. You can append it to the body, the head, or other element. So we start this off with the assumption that we have a <strong>div</strong> with the id of <em>inner_content</em>.</p>
<p>So we start out our JavaScript with:<br />
<code><br />
var main_div = document.getElementById('inner_content');<br />
</code></p>
<p><strong>Second step, what are we going to create?</strong><br />
Let's say we want to add another div with some text inside of it. So, we now create the new div, and append it to our main_div variable.<br />
<code><br />
...<br />
var new_div = document.createElement('div');<br />
...<br />
</code></p>
<p>This div needs some attributes! So let's hop into that, the above snippet turns into:<br />
<code><br />
...<br />
var new_div = document.createElement('div');<br />
new_div.setAttribute('id','sub_div');<br />
new_div.setAttribute('class','mySubDivCssClass');<br />
new_div.setAttribute('onclick','javaScriptFunction()');<br />
...<br />
</code></p>
<p>Now we need to actually attach this item to our old div.</p>
<p>To do that we simply tell our main_div to append a child:<br />
<code><br />
...<br />
main_div.appendChild( new_div );<br />
...<br />
</code></p>
<p>Now, say we want to add a text node... now that gets its own special tool.</p>
<p><code><br />
var new_text = document.createTextNode('My New Text');<br />
</code></p>
<p>And now, just like before, we need to attach that to an item it belongs to.</p>
<p><code><br />
new_div.appendChild( new_text );<br />
</code></p>
<p>Now, we end up with our code snippet looking something like this:</p>
<p><code><br />
var main_div = document.getElementById('inner_content');<br />
var new_div = document.createElement('div');<br />
var new_text = document.createTextNode('My New Text');<br />
// now set up our attributes<br />
new_div.setAttribute('id','sub_div');<br />
new_div.setAttribute('class','mySubDivCssClass');<br />
new_div.setAttribute('onclick','javaScriptFunction()');<br />
// now append the text to the new div<br />
new_div.appendChild( new_text );<br />
// now append our new div to our main div<br />
main_div.appendChild( new_div );<br />
// done.<br />
</code></p>
<p>And that's about as easy as it gets.</p>
<p>Hope this helps someone understand the order that is required when appending new children to the node list.</p>
<p><strong>For more information:</strong></p>
<p><a title="http://www.w3schools.com/htmldom/" href="http://www.w3schools.com/htmldom/" target="_blank">http://www.w3schools.com/htmldom/</a><br />
<a title="http://www.w3.org/TR/DOM-Level-2-HTML/" href="http://www.w3.org/TR/DOM-Level-2-HTML/" target="_blank">http://www.w3.org/TR/DOM-Level-2-HTML/</a><br />
<a title="http://developer.mozilla.org/en/docs/Using_the_W3C_DOM_Level_1_Core" href="http://developer.mozilla.org/en/docs/Using_the_W3C_DOM_Level_1_Core" target="_blank">http://developer.mozilla.org/en/docs/Using_the_W3C_DOM_Level_1_Core</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iwilldomybest.com/2008/08/work-that-dom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP and MySQL Tip #1 &#8211; Error Checks</title>
		<link>http://www.iwilldomybest.com/2007/04/php-and-mysql-tip-1-error-checks/</link>
		<comments>http://www.iwilldomybest.com/2007/04/php-and-mysql-tip-1-error-checks/#comments</comments>
		<pubDate>Tue, 01 May 2007 01:38:26 +0000</pubDate>
		<dc:creator>dschreck</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.e-dirtylaundry.com/2007/09/28/php-and-mysql-tip-1-error-checks/</guid>
		<description><![CDATA[I'd like to share with all of you some PHP Tips. Use error checking when making an SQL query. All too often I see on IRC &#38; Forums people complaining/asking for help, regarding their mysql_query(). "It was working fine yesterday, now it''s broken." "Can someone tell me why this doesn''t work?" "Why doesn''t this work? [...]]]></description>
			<content:encoded><![CDATA[<p>I'd like to share with all of you some PHP Tips.<br />
<span id="more-3"></span><br />
Use error checking when making an SQL query.</p>
<p>All too often I see on IRC &amp; Forums people complaining/asking for help, regarding their mysql_query(). "It was working fine yesterday, now it''s broken." "Can someone tell me why this doesn''t work?" "Why doesn''t this work? It just doesn''t do anything."</p>
<p>People, you <strong>need</strong> to check for errors when you run a query. This is generally done like so:</p>
<p><code><br />
$get = mysql_query($sql) or die (mysql_error());<br />
</code></p>
<p>Now, that in itself is rather simple to understand. If there are any error's with your query ($sql), your script will die() and tell you the error.</p>
<p>An even better implementation of this would be:</p>
<p><code><br />
if(!$get = mysql_query($sql)) {<br />
die("Get query evaluated to false. SQL : {$sql} MySQL Error: ".mysql_error());<br />
}<br />
</code></p>
<p>Now, this is great for debugging purposes. It won't really fly on a live front end site. So you'd swap out the die() with:</p>
<p><code><br />
if(!$get = mysql_query($sql)) {<br />
error_log("Get query evaulted to false. SQL : {$sql} - MySQL Error: ".mysql_error());<br />
} else {<br />
/* Continue on with logic that relies upon this query */<br />
}<br />
</code></p>
<p>Now, what happens is if your query failed, you will get an error_log message, and you <span style="font-style: italic">do</span> check your error logs? Right? Of course! I thought so.<br />
Also, this ensures that only <span style="font-weight: bold">after</span> we know our query was successful do we continue on with our logic that relies upon it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iwilldomybest.com/2007/04/php-and-mysql-tip-1-error-checks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
