<?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>Random Web Tools &#187; Uncategorized</title>
	<atom:link href="http://www.randomtools.net/category/uncategorized/feed" rel="self" type="application/rss+xml" />
	<link>http://www.randomtools.net</link>
	<description>Advice and tools from a young web developer</description>
	<lastBuildDate>Fri, 13 Jan 2012 01:08:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to Properly Test if jQuery is Loaded</title>
		<link>http://www.randomtools.net/how-to-properly-test-if-jquery-is-loaded-144.html</link>
		<comments>http://www.randomtools.net/how-to-properly-test-if-jquery-is-loaded-144.html#comments</comments>
		<pubDate>Fri, 05 Mar 2010 19:49:26 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[How To's]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=144</guid>
		<description><![CDATA[I saw many people claiming you can test for the existence of jQuery like this: 1 2 3 4 5 if &#40;jQuery&#41; &#123; // jQuery exists, put code here &#125; else &#123; // jQuery not loaded, put code here &#125; This is incorrect. It will work fine if jQuery is loaded, but if it&#39;s not [...]]]></description>
			<content:encoded><![CDATA[<p>I saw many people claiming you can test for the existence of jQuery like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// jQuery exists, put code here</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// jQuery not loaded, put code here</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>This is <strong>incorrect</strong>. It will work fine if jQuery is loaded, but if it&#39;s not loaded, javascript will throw an error and the code to execute if jQuery is not loaded will probably not be processed. The modification to fix this is simple:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">jQuery</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// jQuery exists, put code here</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// jQuery not loaded, put code here</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<div style="width: 300px; height: 300px;"><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></div>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/how-to-properly-test-if-jquery-is-loaded-144.html&amp;title=How to Properly Test if jQuery is Loaded' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/how-to-properly-test-if-jquery-is-loaded-144.html&amp;title=How to Properly Test if jQuery is Loaded' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/how-to-properly-test-if-jquery-is-loaded-144.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/how-to-properly-test-if-jquery-is-loaded-144.html&amp;title=How to Properly Test if jQuery is Loaded' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/how-to-properly-test-if-jquery-is-loaded-144.html&amp;title=How to Properly Test if jQuery is Loaded' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/how-to-properly-test-if-jquery-is-loaded-144.html&amp;title=How to Properly Test if jQuery is Loaded' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/how-to-properly-test-if-jquery-is-loaded-144.html&amp;title=How to Properly Test if jQuery is Loaded' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-properly-test-if-jquery-is-loaded-144.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Select Count Distinct &#8211; Counting and Identifying Duplicate Records</title>
		<link>http://www.randomtools.net/mysql-select-count-distinct-counting-and-identifying-duplicate-records-125.html</link>
		<comments>http://www.randomtools.net/mysql-select-count-distinct-counting-and-identifying-duplicate-records-125.html#comments</comments>
		<pubDate>Fri, 22 Jan 2010 03:23:10 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=125</guid>
		<description><![CDATA[Looking for a [relatively] quick way to identify duplicate records in a table and list how many records there are for each duplicate? Look no further. In my case, I&#8217;ve got a table named Searches which tracks queries on one of my sites. I wanted to check the top queries, so I used this SQL [...]]]></description>
			<content:encoded><![CDATA[<div style="width: 300px; height: 300px; float: left; padding-right: 20px;"><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></div>
<p>Looking for a [relatively] quick way to identify duplicate records in a table and list how many records there are for each duplicate? Look no further.</p>
<p>In my case, I&#8217;ve got a table named <strong>Searches</strong> which tracks queries on one of my sites. I wanted to check the top queries, so I used this SQL statement:</p>
<div style="width: 350px; overflow: hidden;">

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">COUNT</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> repetitions<span style="color: #66cc66;">,</span> Query
<span style="color: #993333; font-weight: bold;">FROM</span> Searches
<span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> Query
<span style="color: #993333; font-weight: bold;">HAVING</span> repetitions <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">1</span>
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> repetitions <span style="color: #993333; font-weight: bold;">DESC</span>;</pre></td></tr></table></div>

</div>
<p>There you have it. A simple, effective way to count and label duplicate records.</p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/mysql-select-count-distinct-counting-and-identifying-duplicate-records-125.html&amp;title=MySQL Select Count Distinct &#8211; Counting and Identifying Duplicate Records' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/mysql-select-count-distinct-counting-and-identifying-duplicate-records-125.html&amp;title=MySQL Select Count Distinct &#8211; Counting and Identifying Duplicate Records' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/mysql-select-count-distinct-counting-and-identifying-duplicate-records-125.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/mysql-select-count-distinct-counting-and-identifying-duplicate-records-125.html&amp;title=MySQL Select Count Distinct &#8211; Counting and Identifying Duplicate Records' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/mysql-select-count-distinct-counting-and-identifying-duplicate-records-125.html&amp;title=MySQL Select Count Distinct &#8211; Counting and Identifying Duplicate Records' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/mysql-select-count-distinct-counting-and-identifying-duplicate-records-125.html&amp;title=MySQL Select Count Distinct &#8211; Counting and Identifying Duplicate Records' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/mysql-select-count-distinct-counting-and-identifying-duplicate-records-125.html&amp;title=MySQL Select Count Distinct &#8211; Counting and Identifying Duplicate Records' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/mysql-select-count-distinct-counting-and-identifying-duplicate-records-125.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>30 Google Wave Invites</title>
		<link>http://www.randomtools.net/30-google-wave-invites-118.html</link>
		<comments>http://www.randomtools.net/30-google-wave-invites-118.html#comments</comments>
		<pubDate>Thu, 19 Nov 2009 01:44:50 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=118</guid>
		<description><![CDATA[I&#39;ve got 30 more Google Wave invites to give away. Leave a comment with your email and I&#39;ll send them. First come, first serve. This is actually a nomination and it may take a little while before you get your actual invite. &#160; From now on, you must retweet the bitly URL (http://bit.ly/2rwYsG) on twitter [...]]]></description>
			<content:encoded><![CDATA[<table>
<tbody>
<tr>
<td><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></td>
<td><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></td>
</tr>
</tbody>
</table>
<p><a href="http://www.randomtools.net/wp-content/uploads/2009/11/Google-Wave-logo.jpg"><img alt="Google Wave logo" class="alignright size-thumbnail wp-image-120" height="150" src="http://www.randomtools.net/wp-content/uploads/2009/11/Google-Wave-logo-150x150.jpg" title="Google Wave logo" width="150" /></a>I&#39;ve got 30 more Google Wave invites to give away. Leave a comment with your email and I&#39;ll send them. First come, first serve.</p>
<p>This is actually a nomination and it may take a little while before you get your actual invite.</p>
<p>&nbsp;</p>
<p>From now on, you must retweet the bitly URL (http://bit.ly/2rwYsG) on twitter and reply to me in order to get an invite.</p>
<p><strong>Example tweet:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">@xoise Free Google Wave invites: http://bit.ly/2rwYsG #GoogleWave</pre></div></div>

<p>Then put a comment in the comment section and don&#39;t forget your email (doesn&#39;t have to be public).</p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/30-google-wave-invites-118.html&amp;title=30 Google Wave Invites' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/30-google-wave-invites-118.html&amp;title=30 Google Wave Invites' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/30-google-wave-invites-118.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/30-google-wave-invites-118.html&amp;title=30 Google Wave Invites' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/30-google-wave-invites-118.html&amp;title=30 Google Wave Invites' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/30-google-wave-invites-118.html&amp;title=30 Google Wave Invites' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/30-google-wave-invites-118.html&amp;title=30 Google Wave Invites' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/30-google-wave-invites-118.html/feed</wfw:commentRss>
		<slash:comments>47</slash:comments>
		</item>
		<item>
		<title>How to retrive Yahoo Backlinks count with PHP</title>
		<link>http://www.randomtools.net/how-to-retrive-yahoo-backlinks-count-with-php-113.html</link>
		<comments>http://www.randomtools.net/how-to-retrive-yahoo-backlinks-count-with-php-113.html#comments</comments>
		<pubDate>Sun, 08 Nov 2009 19:38:27 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=113</guid>
		<description><![CDATA[Here&#39;s a simple script to retrieve the approximate number of backlinks Yahoo has for a site. The function and how to call it follows: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 function get_yahoo_backlinks_count&#40;$url&#41; &#123; $appid = ''; // get this from https://developer.apps.yahoo.com/wsregapp/ $url = &#34;http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=$appid&#38;query=site:$url&#38;results=1&#34;; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#39;s a simple script to retrieve the approximate number of backlinks Yahoo has for a site. The function and how to call it follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> get_yahoo_backlinks_count<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$appid</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// get this from https://developer.apps.yahoo.com/wsregapp/</span>
	<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=<span style="color: #006699; font-weight: bold;">$appid</span>&amp;query=site:<span style="color: #006699; font-weight: bold;">$url</span>&amp;results=1&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_REFERER<span style="color: #339933;">,</span> <span style="color: #0000ff;">'http://www.yoursite.com/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #990000;">simplexml_load_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$xml</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">attributes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">totalResultsAvailable</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> get_yahoo_backlinks_count<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'google.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<div style="width: 300px; height: 300px; clear: both;"><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></div>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/how-to-retrive-yahoo-backlinks-count-with-php-113.html&amp;title=How to retrive Yahoo Backlinks count with PHP' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/how-to-retrive-yahoo-backlinks-count-with-php-113.html&amp;title=How to retrive Yahoo Backlinks count with PHP' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/how-to-retrive-yahoo-backlinks-count-with-php-113.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/how-to-retrive-yahoo-backlinks-count-with-php-113.html&amp;title=How to retrive Yahoo Backlinks count with PHP' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/how-to-retrive-yahoo-backlinks-count-with-php-113.html&amp;title=How to retrive Yahoo Backlinks count with PHP' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/how-to-retrive-yahoo-backlinks-count-with-php-113.html&amp;title=How to retrive Yahoo Backlinks count with PHP' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/how-to-retrive-yahoo-backlinks-count-with-php-113.html&amp;title=How to retrive Yahoo Backlinks count with PHP' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-retrive-yahoo-backlinks-count-with-php-113.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to retrieve Google Backlinks count with PHP</title>
		<link>http://www.randomtools.net/how-to-retrieve-google-backlinks-count-with-php-109.html</link>
		<comments>http://www.randomtools.net/how-to-retrieve-google-backlinks-count-with-php-109.html#comments</comments>
		<pubDate>Sun, 08 Nov 2009 19:12:06 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=109</guid>
		<description><![CDATA[Here&#39;s a simple script to retrieve the approximate number of backlinks Google has for a site. The function and how to call it follows: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 function get_google_backlinks_count&#40;$url&#41; &#123; $url = &#34;http://ajax.googleapis.com/ajax/services/search/web?v=1.0&#38;q=site:$url&#34; &#160; $ch = curl_init&#40;&#41;; curl_setopt&#40;$ch, CURLOPT_URL, $url&#41;; curl_setopt&#40;$ch, CURLOPT_RETURNTRANSFER, 1&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#39;s a simple script to retrieve the approximate number of backlinks Google has for a site. The function and how to call it follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> get_google_backlinks_count<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://ajax.googleapis.com/ajax/services/search/web?v=1.0&amp;q=site:<span style="color: #006699; font-weight: bold;">$url</span>&quot;</span>
&nbsp;
	<span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_REFERER<span style="color: #339933;">,</span> <span style="color: #0000ff;">'http://www.yoursite.com/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$json</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$json</span> <span style="color: #339933;">-&gt;;</span> responseData <span style="color: #339933;">-&gt;;</span> cursor <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">estimatedResultCount</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> get_google_backlinks_count<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'yahoo.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<div style="width: 300px; height: 300px; clear: both;"><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></div>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/how-to-retrieve-google-backlinks-count-with-php-109.html&amp;title=How to retrieve Google Backlinks count with PHP' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/how-to-retrieve-google-backlinks-count-with-php-109.html&amp;title=How to retrieve Google Backlinks count with PHP' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/how-to-retrieve-google-backlinks-count-with-php-109.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/how-to-retrieve-google-backlinks-count-with-php-109.html&amp;title=How to retrieve Google Backlinks count with PHP' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/how-to-retrieve-google-backlinks-count-with-php-109.html&amp;title=How to retrieve Google Backlinks count with PHP' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/how-to-retrieve-google-backlinks-count-with-php-109.html&amp;title=How to retrieve Google Backlinks count with PHP' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/how-to-retrieve-google-backlinks-count-with-php-109.html&amp;title=How to retrieve Google Backlinks count with PHP' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-retrieve-google-backlinks-count-with-php-109.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Simple PHP script for unzip function</title>
		<link>http://www.randomtools.net/simple-php-script-for-unzip-function-101.html</link>
		<comments>http://www.randomtools.net/simple-php-script-for-unzip-function-101.html#comments</comments>
		<pubDate>Tue, 27 Oct 2009 04:38:31 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=101</guid>
		<description><![CDATA[Here&#8217;s a simple PHP function to unzip a ZIP file and retain directory structure &#8211; great for use when you can&#8217;t use exec(). The function will return false on error and true on success. Call it with the following code: 1 2 3 4 if &#40;unzip&#40;'../mtm.zip'&#41;&#41; echo 'Cool, it worked!'; else echo 'Uh oh, something [...]]]></description>
			<content:encoded><![CDATA[<p>
	Here&#8217;s a simple PHP function to unzip a ZIP file and retain directory structure &#8211; great for use when you can&#8217;t use exec(). The function will return false on error and true on success. Call it with the following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>unzip<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'../mtm.zip'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Cool, it worked!'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Uh oh, something went wrong.'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> unzip<span style="color: #009900;">&#40;</span><span style="color: #000088;">$zipfile</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$zip</span> <span style="color: #339933;">=</span> <span style="color: #990000;">zip_open</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$zipfile</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$zip</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span> <span style="color: #339933;">=</span> <span style="color: #990000;">zip_read</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$zip</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #990000;">zip_entry_name</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'/'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000088;">$dir</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mkdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #990000;">zip_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$zip</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">zip_entry_open</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$zip</span><span style="color: #339933;">,</span> <span style="color: #000088;">$item</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000088;">$f</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_put_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #339933;">,</span> <span style="color: #990000;">zip_entry_read</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #339933;">,</span> <span style="color: #990000;">zip_entry_filesize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #990000;">zip_entry_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #990000;">zip_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$zip</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #990000;">zip_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$zip</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #990000;">zip_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$zip</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<div style="clear: both; width: 300px; height: 300px;">
	<div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></div>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/simple-php-script-for-unzip-function-101.html&amp;title=Simple PHP script for unzip function' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/simple-php-script-for-unzip-function-101.html&amp;title=Simple PHP script for unzip function' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/simple-php-script-for-unzip-function-101.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/simple-php-script-for-unzip-function-101.html&amp;title=Simple PHP script for unzip function' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/simple-php-script-for-unzip-function-101.html&amp;title=Simple PHP script for unzip function' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/simple-php-script-for-unzip-function-101.html&amp;title=Simple PHP script for unzip function' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/simple-php-script-for-unzip-function-101.html&amp;title=Simple PHP script for unzip function' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/simple-php-script-for-unzip-function-101.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to easily display errors in PHP scripts</title>
		<link>http://www.randomtools.net/how-to-easily-display-errors-in-php-scripts-96.html</link>
		<comments>http://www.randomtools.net/how-to-easily-display-errors-in-php-scripts-96.html#comments</comments>
		<pubDate>Mon, 26 Oct 2009 23:51:01 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=96</guid>
		<description><![CDATA[Put the following two lines of code before any PHP code you want to display errors for. 1 2 3 4 &#60;?php ini_set&#40;'display_errors', 'on'&#41;; error_reporting&#40;E_ALL&#41;; ?&#62; Bookmark this page]]></description>
			<content:encoded><![CDATA[<p>Put the following two lines of code before any PHP code you want to display errors for.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'display_errors'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'on'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">error_reporting</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">E_ALL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<div style="width: 300px; height: 300px; clear: both;"><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></div>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/how-to-easily-display-errors-in-php-scripts-96.html&amp;title=How to easily display errors in PHP scripts' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/how-to-easily-display-errors-in-php-scripts-96.html&amp;title=How to easily display errors in PHP scripts' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/how-to-easily-display-errors-in-php-scripts-96.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/how-to-easily-display-errors-in-php-scripts-96.html&amp;title=How to easily display errors in PHP scripts' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/how-to-easily-display-errors-in-php-scripts-96.html&amp;title=How to easily display errors in PHP scripts' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/how-to-easily-display-errors-in-php-scripts-96.html&amp;title=How to easily display errors in PHP scripts' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/how-to-easily-display-errors-in-php-scripts-96.html&amp;title=How to easily display errors in PHP scripts' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-easily-display-errors-in-php-scripts-96.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Duplicate Database Rows in MySQL</title>
		<link>http://www.randomtools.net/how-to-duplicate-database-rows-in-mysql-89.html</link>
		<comments>http://www.randomtools.net/how-to-duplicate-database-rows-in-mysql-89.html#comments</comments>
		<pubDate>Wed, 21 Oct 2009 23:14:42 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=89</guid>
		<description><![CDATA[If you&#39;re looking for a quick, easy way to duplicate a MySQL Row, try the following example: 1 2 3 4 5 6 INSERT INTO Tbl1 &#40;Col2, Col3, ...&#41; SELECT &#40;Col2, Col3, ...&#41; FROM Tbl1 WHERE Col1 = 1; This example assumes you want to duplicate the row where Col1 equals 1. You could change [...]]]></description>
			<content:encoded><![CDATA[<p>
	If you&#39;re looking for a quick, easy way to duplicate a MySQL Row, try the following example:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> Tbl1
		<span style="color: #66cc66;">&#40;</span>Col2<span style="color: #66cc66;">,</span> Col3<span style="color: #66cc66;">,</span> <span style="color: #66cc66;">...</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #993333; font-weight: bold;">SELECT</span>
		<span style="color: #66cc66;">&#40;</span>Col2<span style="color: #66cc66;">,</span> Col3<span style="color: #66cc66;">,</span> <span style="color: #66cc66;">...</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #993333; font-weight: bold;">FROM</span> Tbl1
		<span style="color: #993333; font-weight: bold;">WHERE</span> Col1 <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span>;</pre></td></tr></table></div>

<p>
	This example assumes you want to duplicate the row where Col1 equals 1. You could change the where clause to anything for that matter. However, if there are more than one rows selected from the SELECT statement, it will INSERT each row, not just one.</p>
<p>
	Likewise, you could duplicate a whole MySQL table using the following:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> Tbl2
		<span style="color: #66cc66;">&#40;</span>Col2<span style="color: #66cc66;">,</span> Col3<span style="color: #66cc66;">,</span> <span style="color: #66cc66;">...</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #993333; font-weight: bold;">SELECT</span>
		<span style="color: #66cc66;">&#40;</span>Col2<span style="color: #66cc66;">,</span> Col3<span style="color: #66cc66;">,</span> <span style="color: #66cc66;">...</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #993333; font-weight: bold;">FROM</span> Tbl1;</pre></td></tr></table></div>

<div style="clear: both; height: 270px;">
	<div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></div>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/how-to-duplicate-database-rows-in-mysql-89.html&amp;title=How to Duplicate Database Rows in MySQL' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/how-to-duplicate-database-rows-in-mysql-89.html&amp;title=How to Duplicate Database Rows in MySQL' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/how-to-duplicate-database-rows-in-mysql-89.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/how-to-duplicate-database-rows-in-mysql-89.html&amp;title=How to Duplicate Database Rows in MySQL' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/how-to-duplicate-database-rows-in-mysql-89.html&amp;title=How to Duplicate Database Rows in MySQL' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/how-to-duplicate-database-rows-in-mysql-89.html&amp;title=How to Duplicate Database Rows in MySQL' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/how-to-duplicate-database-rows-in-mysql-89.html&amp;title=How to Duplicate Database Rows in MySQL' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-duplicate-database-rows-in-mysql-89.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free Google Wave Invites</title>
		<link>http://www.randomtools.net/free-google-wave-invites-84.html</link>
		<comments>http://www.randomtools.net/free-google-wave-invites-84.html#comments</comments>
		<pubDate>Tue, 06 Oct 2009 05:27:19 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=84</guid>
		<description><![CDATA[Hey, I&#8217;ve got 8 Google Wave invites to give out. If you want one, hit me up. It&#8217;ll be a first come, first serve sort of deal! Shoot me an email or leave a comment. &#160; Bookmark this page]]></description>
			<content:encoded><![CDATA[<p>Hey, I&#8217;ve got 8 Google Wave invites to give out. If you want one, hit me up. It&#8217;ll be a first come, first serve sort of deal!</p>
<p>Shoot me an email or leave a comment.</p>
<p style="float: left;"><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></p>
<p style="float: left;"><img alt="" src="http://img198.imageshack.us/img198/2001/googlewavelogo.jpg" /></p>
<div style="clear: both;">&nbsp;</div>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/free-google-wave-invites-84.html&amp;title=Free Google Wave Invites' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/free-google-wave-invites-84.html&amp;title=Free Google Wave Invites' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/free-google-wave-invites-84.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/free-google-wave-invites-84.html&amp;title=Free Google Wave Invites' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/free-google-wave-invites-84.html&amp;title=Free Google Wave Invites' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/free-google-wave-invites-84.html&amp;title=Free Google Wave Invites' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/free-google-wave-invites-84.html&amp;title=Free Google Wave Invites' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/free-google-wave-invites-84.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>How to mount Amazon EC2 EBS volume on an instance&#8217;s file system</title>
		<link>http://www.randomtools.net/how-to-mount-amazon-ec2-ebs-volume-on-an-instances-file-system-76.html</link>
		<comments>http://www.randomtools.net/how-to-mount-amazon-ec2-ebs-volume-on-an-instances-file-system-76.html#comments</comments>
		<pubDate>Wed, 30 Sep 2009 23:45:48 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=76</guid>
		<description><![CDATA[The following assumes you have created a volume in AWS Management Console and attached it to your instance as /dev/sdh. &#160; A brand new volume is unformatted block storage. &#160;It shows up as another device, but doesn&#8217;t contain a filesystem. &#160;(An EBS volume that previously had a filesystem created on it won&#8217;t be mounted either [...]]]></description>
			<content:encoded><![CDATA[<div style="float:right; margin: 5px;"><div style="width: 300px; height: 250px; margin: 3px;"><script type="text/javascript"><!--
google_ad_client = "pub-1936238606905173";
google_ad_slot = "4013486594";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div></div>
<div>The following assumes you have created a volume in AWS Management Console and attached it to your instance as /dev/sdh.</div>
<div>&nbsp;</div>
<div>A brand new volume is unformatted block storage. &nbsp;It shows up as another device, but doesn&#8217;t contain a filesystem. &nbsp;(An EBS volume that previously had a filesystem created on it won&#8217;t be mounted either by the attachment process).</div>
<div>&nbsp;</div>
<div>You can verify that your instance can see the EBS volume by running the following command on the instance:</div>
<div>&nbsp;</div>
<div>cat /proc/partitions</div>
<div>&nbsp;</div>
<div>You&#8217;ll see an entry for sdh. &nbsp;At this point, you should create a filesystem and mount it manually. &nbsp;You could create an EXT3 filesystem on the device and then mount it on &#8216;/mnt/ebs&#8217; with the following commands, (run as root):</div>
<div>&nbsp;</div>
<div>mke2fs -F -j /dev/sdh</div>
<div>mkdir /mnt/ebs</div>
<p>mount /dev/sdh /mnt/ebs&nbsp;</p>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/how-to-mount-amazon-ec2-ebs-volume-on-an-instances-file-system-76.html&amp;title=How to mount Amazon EC2 EBS volume on an instance&#8217;s file system' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/how-to-mount-amazon-ec2-ebs-volume-on-an-instances-file-system-76.html&amp;title=How to mount Amazon EC2 EBS volume on an instance&#8217;s file system' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/how-to-mount-amazon-ec2-ebs-volume-on-an-instances-file-system-76.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/how-to-mount-amazon-ec2-ebs-volume-on-an-instances-file-system-76.html&amp;title=How to mount Amazon EC2 EBS volume on an instance&#8217;s file system' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/how-to-mount-amazon-ec2-ebs-volume-on-an-instances-file-system-76.html&amp;title=How to mount Amazon EC2 EBS volume on an instance&#8217;s file system' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/how-to-mount-amazon-ec2-ebs-volume-on-an-instances-file-system-76.html&amp;title=How to mount Amazon EC2 EBS volume on an instance&#8217;s file system' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/how-to-mount-amazon-ec2-ebs-volume-on-an-instances-file-system-76.html&amp;title=How to mount Amazon EC2 EBS volume on an instance&#8217;s file system' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-mount-amazon-ec2-ebs-volume-on-an-instances-file-system-76.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

