<?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>iD Tech Camps - America's #1 Tech Camp&#187; KenK</title>
	<atom:link href="http://www.internaldrive.com/author/kenk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.internaldrive.com</link>
	<description>America's #1 Tech Camp</description>
	<lastBuildDate>Thu, 02 Sep 2010 00:36:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Making a Poll in PHP from Scratch: Part 1</title>
		<link>http://www.internaldrive.com/2009/05/14/making-a-poll-in-php-from-scratch-part-1/</link>
		<comments>http://www.internaldrive.com/2009/05/14/making-a-poll-in-php-from-scratch-part-1/#comments</comments>
		<pubDate>Thu, 14 May 2009 16:16:39 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[internet poll]]></category>
		<category><![CDATA[internet polls]]></category>
		<category><![CDATA[internet voting]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php mysql]]></category>
		<category><![CDATA[php poll]]></category>
		<category><![CDATA[poll]]></category>
		<category><![CDATA[voting]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=22676</guid>
		<description><![CDATA[There are plenty of ready-made Internet polls out there, particularly if you are using a framework for your site such as Wordpress, vBulletin, or Joomla/Drupal. But occasionally it is worthwhile to create your own from scratch, whether for learning or to simply fulfill specific features you need in your application. In this series of posts, [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>There are plenty of ready-made Internet polls out there, particularly if you are using a framework for your site such as Wordpress, vBulletin, or Joomla/Drupal. But occasionally it is worthwhile to create your own from scratch, whether for learning or to simply fulfill specific features you need in your application. In this series of posts, that is exactly what we will create &#8211; a homemade PHP/MySQL voting page. You should be then able to modify this code for your specific needs.</p>
<p>First, let&#8217;s talk about the inherent flaws in Internet voting. In the most basic form, an Internet poll is just a choice a person makes on a page that is stored in the database. Without any checks, a person could just refresh the page and vote over and over again. Or, worse, they could employ a script of their own that does this automatically. You could potentially register millions of votes this way, given enough time. So what checks and balances do we have? There are three main options.</p>
<h2>User Login</h2>
<p>A user login system is the most secure of your options, especially if the accounts are linked to a unique email address. If you are using a system like Wordpress or Drupal, then it is trivial to store the userid of the voter in the database as well. Do you want to use this option with your poll? If the user is already logging in for other reasons, then this is probably fine. Making a user register just to vote in a poll brings the convenience factor way down, most likely deterring most people. Plus, is it really worth it? If a user has the time and inclination, they can simply register over and over again, especially if they have their own domain or email server from which to pull infinite accounts. You could employ some IP-checking with your account checks to make sure they are unique, but then it just becomes an arms race. This option is too burdernsome for us to use in this project.</p>
<h2>Cookies</h2>
<p>We could use cookies set on a person&#8217;s machine to determine whether they&#8217;ve voted or not, but all it takes is a browser switch, cleared cache, or a privacy mode and suddenly our checking goes right out the window. This option is almost too simple for the user to overcome.</p>
<h2>IP Address</h2>
<p>The last major option is an IP address check. There are several flaws with this method, like the others, but we can overcome a few of them more easily. First, IP addresses are not a one-address-to-one-person mapping. The system can go either way, in fact. You can have multiple IPs for a single person, if they have multiple systems, a cellphone, so on. You can also have multiple people for an IP, in the case of a corporate network. You could have 10,000 people registering as a single IP. But these are problems we can find workarounds for.  We&#8217;ll use IP checking in conjuction with a few tricks as our authentication method.</p>
<h2>Database Structure: Your Favorite Fruit</h2>
<p>For this poll, I&#8217;m creating two different database tables, <strong>mypoll</strong> and <strong>mypolltally</strong>. The first table will contain all of the choices in our poll and the second the individual votes. This means that we can only have a single poll at a time, but this is a trivial matter in the future to extend (we would simply add another column to <strong>mypoll</strong>, <em>pollid</em>, containing a unique identifier. Then we would just need a column in mypolltally to store the <em>pollid</em> of each vote).</p>
<pre>         mypoll                                 mypolltally
--------------------------      --------------------------------------------
| id |      choice       |      | id | isvotefor |    ipaddress    | value |
--------------------------      --------------------------------------------
| 0  | banana            |      | 0  |     3     | 255.255.255.255 |   1   |
| 1  | apple             |      | 1  |     4     | 254.255.255.255 |   1   |
| 2  | orange            |      | 2  |     1     | 251.255.255.255 |   1   |
| 3  | strawberry        |      | 3  |     2     | 252.255.255.255 |   1   |
| 4  | blueberry         |      | 4  |     2     | 253.255.255.255 |   1   |
--------------------------      --------------------------------------------</pre>
<h2>The Fields</h2>
<p><strong>mypoll:</strong></p>
<ul>
<li><strong>id</strong>: A unique identifier for records in the table. When we register a vote in <strong>mypolltally</strong>, we&#8217;ll need to know which option we are voting for. We&#8217;ll use this value to do so.</li>
<li><strong>choice</strong>: The text for each option. Our poll question is &#8220;What is your favorite fruit?&#8221;, so here we lay out the choices such as</li>
<li><em>banana</em>, <em>apple</em>, and <em>orange</em>.</li>
</ul>
<p><strong>mypolltally:</strong></p>
<ul>
<li><strong>id</strong>: A unique identifier for each vote in the system.</li>
<li><strong>isvotefor</strong>: This field points identifies which option in <strong>mypoll</strong> that this vote is selecting.</li>
<li><strong>ipaddress</strong>:The IP address of the voter.</li>
<li><strong>value</strong>:We can extend our features a little by having this field. Instead of simply registering a &#8220;Yes&#8221; for a particular option, we can register a range. We can then allow people to indicate <em>how much</em> they like the option. Perhaps a <strong>1</strong> value is a little, a <strong>5</strong> value is a lot, and anything negative means they do not like it. For now, a value of <strong>1</strong> will just mean yes but later we&#8217;ll extend it for enhanced voting.</li>
</ul>
<p>That&#8217;s enough of the theory for now. In the next part of the series we&#8217;ll launch into the actual PHP code and finish up with the basic functionality. In Part 3 we&#8217;ll extend our code to allow for more features.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/05/14/making-a-poll-in-php-from-scratch-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Randomizing your Flickr to vBulletin Feed</title>
		<link>http://www.internaldrive.com/2009/05/07/randomizing-your-flickr-to-vbulletin-feed/</link>
		<comments>http://www.internaldrive.com/2009/05/07/randomizing-your-flickr-to-vbulletin-feed/#comments</comments>
		<pubDate>Thu, 07 May 2009 18:08:24 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[Flickr API]]></category>
		<category><![CDATA[non-repeating random numbers]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpFlickr]]></category>
		<category><![CDATA[random numbers]]></category>
		<category><![CDATA[vBulletin]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=22451</guid>
		<description><![CDATA[Last time I discussed pulling your Flickr feed into a vBulletin installation (or really, any php-based CMS/website). That solution pulled the lastest photos up to some amount and displayed them. But what if you want to randomize them and not always display the pictures in the same order? We&#8217;ll be pulling a large amount of [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Last time I discussed <a href="http://www.internaldrive.com/2009/04/30/integrating-flickr-with-vbulletin/" target="_blank">pulling your Flickr feed into a vBulletin installation</a> (or really, any php-based CMS/website). That solution pulled the lastest photos up to some amount and displayed them. But what if you want to randomize them and not always display the pictures in the same order? We&#8217;ll be pulling a large amount of photos from Flickr and I don&#8217;t always want only the last ones to show up in the same order. Instead, I&#8217;d like to pull the last, say, 200 photos and randomly display 10 of them. Here&#8217;s the code modification from last week&#8217;s post:</p>
<pre style="padding: 30px 0px 30px 30px;">require_once("includes/phpFlickr.php");

// Create new phpFlickr object
$f = new phpFlickr("yourapikey");

$f-&gt;enableCache("db","mysql://user:password@server/database");

<span style="color: #ff0000;">$limit = 200;</span>
<span style="color: #ff0000;">$count = 10;</span>

// Find the NSID of the username inputted via the form
$person = $f-&gt;people_findByUsername('iDTechCamp');

// Get the friendly URL of the user's photos
$photos_url = $f-&gt;urls_getUserPhotos($person['id']);

// Get the user's first X($limit) public photos
$photos = $f-&gt;people_getPublicPhotos($person['id'], NULL, NULL, $limit);

$flickrbox = "&lt;table class='flickrbox'&gt;&lt;tr&gt;";
<span style="color: #ff0000;">$nonrepeatarray = array();</span>

<span style="color: #ff0000;">for ($i = 0; $i &lt; $count; $i++) {
    $rand = rand(0,199);
    while(in_array($rand,$nonrepeatarray)) $rand = rand(0,199);
    array_push($nonrepeatarray, $rand);

    $photo = (array)$photos['photos']['photo'][$rand];</span>
    $flickrbox .= "&lt;td&gt;&lt;a class='flickrimg' href=$photos_url$photo[id]&gt;";
    $flickrbox .= "&lt;img border='0' alt='$photo[title]' "
               ."src=" . $f-&gt;buildPhotoURL($photo, "Square") . "&gt;";
    $flickrbox .= "&lt;/a&gt;&lt;/td&gt;";
}

$flickrbox .= "&lt;/tr&gt;&lt;/table&gt;";</pre>
<p>You can see I&#8217;ve highlighted the altered sections in red. First, we up the <strong>$limit</strong> to 200. Then we introduce a new variable, <strong>$count</strong>. This variable will contain the number of photos we&#8217;d like displayed of the 200 we&#8217;re pulling. Next we change our <strong>foreach</strong> loop into a regular <strong>for</strong> loop. We will then randomly generate a number between 0 and 199 (remembering that arrays begin at 0, not 1). We run a <strong>while </strong>loop to check if that number is already in an array we&#8217;ve been keeping called <strong>$nonrepeatarray</strong>. If it is there, we draw another number. If it isn&#8217;t, we exit that loop, add it to the array, and keep moving with the portion of the loop dedicated to building the image display.</p>
<p>Although this may not be the most efficient method, it is simple. Plus, we have caching enabled through the phpFlickr API, so that will help. Other ways of doing the exact same thing include generating an array containing the values 0-199, shuffling the array, and then popping off one element each time. You are guaranteed not to have repeats.</p>
<p>For other methods of generating random, non-repeating numbers, with sample code, see here: http://www.phpbuilder.com/board/showthread.php?t=10329337.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/05/07/randomizing-your-flickr-to-vbulletin-feed/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Integrating Flickr with vBulletin</title>
		<link>http://www.internaldrive.com/2009/04/30/integrating-flickr-with-vbulletin/</link>
		<comments>http://www.internaldrive.com/2009/04/30/integrating-flickr-with-vbulletin/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 17:40:08 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[changes]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[Flickr API]]></category>
		<category><![CDATA[Manager]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Objects]]></category>
		<category><![CDATA[photo]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpFlickr]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[vBulletin]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=22446</guid>
		<description><![CDATA[Our support forums here at iD Tech run on the popular internet forum software, vBulletin. Each year we constantly revamp the system with new upgrades, a new design, and new code plugins to make the process more specific to our business model and more accessible to our staff.
In addition, we also have a public Flickr [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Our support forums here at iD Tech run on the popular internet forum software, <a title="vBulletin" href="http://www.vbulletin.com" target="_blank">vBulletin</a>. Each year we constantly revamp the system with new upgrades, a new design, and new code plugins to make the process more specific to our business model and more accessible to our staff.</p>
<p>In addition, we also have a public Flickr stream. I wanted to pull these two elements together so that we could bring examples of our Flickr photos to our own support system. Here&#8217;s how I integrated them.</p>
<ol style="padding-left: 30px;">
<li>Download the phpFlickr API from here: http://www.phpflickr.com/</li>
<li>Unzip the files to your vBulletin <strong>/includes/</strong> folder.</li>
<li>If you want, you can rename the files to match the vBulletin naming convention (i.e. phpflickr.php -&gt; functions_phpflickr.php).</li>
<li><strong>Optional: </strong>Create a new vBulletin product. From the admin side, choose <strong>Manage Products</strong> from the <strong>Plugins &amp; Products </strong>menu. Then select <strong>Add/Import</strong> product. Fill in the information you need for a new product and hit save.</li>
<li> Add a new vBulletin plugin. From the <strong>Plugins &amp; Products </strong>admin menu, select <strong>Add New Plugin</strong>. Select the product you created in <strong>Step 4</strong>, or <strong>vBulletin</strong> otherwise. For hook location, you&#8217;ll need to select where you want the Flickr photos displayed. I&#8217;m placing them on our vBulletin homepage, so I select <strong>forumhome_start </strong>for my hook. Enter a title (such as <strong>Flickr Integration</strong>), leave the exectution order alone, and use the PHP code shown below.</li>
<li>From the <strong>Styles &amp; Templates </strong>menu, select <strong>Style Manager</strong>. Pick your style and choose <strong>Edit Templates</strong>. Find <strong>FORUMHOME </strong>(or whichever style is applicable to the hook location you chose) and double-click on it.</li>
<li> Find the location in the template where you want your photos displayed and enter <strong>$flickrbox</strong>, the name of the variable we are pulling from our PHP plugin.</li>
</ol>
<p>Now let&#8217;s take a look at the code we&#8217;re placing in our plugin.</p>
<pre style="padding: 30px 0px 30px 30px;">require_once("includes/phpFlickr.php");

// Create new phpFlickr object
$f = new phpFlickr("yourapikey");
$f-&gt;enableCache("db","mysql://user:password@server/database");

$limit = 11;

// Find the NSID of the username inputted via the form
$person = $f-&gt;people_findByUsername('iDTechCamp');

// Get the friendly URL of the user's photos
$photos_url = $f-&gt;urls_getUserPhotos($person['id']);

// Get the user's first X($limit) public photos
$photos = $f-&gt;people_getPublicPhotos($person['id'], NULL, NULL, $limit);
$flickrbox = "&lt;table class='flickrbox'&gt;&lt;tr&gt;";

// Loop through the photos and output the html
foreach ((array)$photos['photos']['photo'] as $photo) {
    $flickrbox .= "&lt;td&gt;&lt;a class='flickrimg' href=$photos_url$photo[id]&gt;";
    $flickrbox .= "&lt;img border='0' alt='$photo[title]' "
               ."src=" . $f-&gt;buildPhotoURL($photo, "Square") . "&gt;";
    $flickrbox .= "&lt;/a&gt;&lt;/td&gt;";
}

$flickrbox .= "&lt;/tr&gt;&lt;/table&gt;";</pre>
<p>First, we <strong>require_once</strong> the phpflickr php api library. Alter this line if you choose to name your library differently. Next, we create a new phpFlickr object, <strong>$f</strong>, and supply our Flickr API key. Change this line to reflect your unique API key. Next, we optionally enable the cache available with this library by supplying our mySQL database details. If you don&#8217;t have your details, don&#8217;t worry, this step isn&#8217;t required.</p>
<p>We then set a limit for how many photos we want. I&#8217;ve chosen 11. We use <strong>people_findByUsername</strong> to get photos for our particular user, in this case, the company username <strong>iDTechCamp</strong>. The resulting statements will pull <strong>$limit</strong> number of photos from the public profile of our user. Lastly, we need to construct a variable that holds the output as HTML. Our variable here is <strong>$flickrbox</strong> and as you can see I&#8217;m generating a table with CSS class style named <strong>flickrbox</strong>. Each image in the table is table cell and contains a link to that particular image. We also set the image title to the photo title pulled from <strong>Flickr</strong>.</p>
<p>You can easily alter the PHP code here to produce tableless HTML or any other structure you like. I hope these instructions help you to integrate your board and Flickr! Email me or comment with any questions you might have.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/04/30/integrating-flickr-with-vbulletin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tech Pranks</title>
		<link>http://www.internaldrive.com/2009/04/21/tech-pranks/</link>
		<comments>http://www.internaldrive.com/2009/04/21/tech-pranks/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 18:02:37 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[annoying]]></category>
		<category><![CDATA[coworkers]]></category>
		<category><![CDATA[cube warfare]]></category>
		<category><![CDATA[pranks]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[tech pranks]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=22044</guid>
		<description><![CDATA[Let&#8217;s talk about pranks. Specifically, pranks involving technology. If you access to some fairly common technology, you can prank like never before. Here are a few options:
Ghost Writing
This prank is simple. If you have a coworker nearby, find an extra USB keyboard (you could even use your own) and, depending on how far you are [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Let&#8217;s talk about pranks. Specifically, pranks involving technology. If you access to some fairly common technology, you can prank like never before. Here are a few options:</p>
<h2>Ghost Writing</h2>
<p>This prank is simple. If you have a coworker nearby, find an extra USB keyboard (you could even use your own) and, depending on how far you are from your coworker&#8217;s computer, one or more USB extension cords. Plug your extension into their computer when they aren&#8217;t around and discreetly run the cord over to your computer where you plug in either your keyboard or an extra one. Alternatively, you can use an extra mouse instead.</p>
<p>The key to this prank is subtlety. Most operating systems allow multiple input devices, so you can simultaneously use two keyboards. As you go through the day, sporadically type a few characters here and there on your extension keyboard, especially when your coworker is working on a document, or email. You don&#8217;t want them to become overly suspicious, but instead think that they are having trouble typing. Just an extra letter here and there to start.</p>
<p>Other methods of subtle harrassment with this technique include randomly pressing the Windows key (or some other function-type key) or turning Capslock on occasionally. Again, don&#8217;t over do it or it will raise suspicion. If you opted for the mouse instead, small movements or the occasional right-click should do just fine.</p>
<h3>Materials:</h3>
<ul>
<li>USB extension cord(s)</li>
<li>USB keyboard</li>
</ul>
<h2>Hidden Friend</h2>
<p>This prank requires any sort of device that can occasionally make noise. The original prank began with a stopwatch we received from a vendor for free, though you can use any similar device that can be set to beep on a regular interval. In this case, I set the time incorrectly so that the hourly beep wouldn&#8217;t occur on the hour for further annoyance. Just hide the watch somewhere and wait for the fun begins.<br />
If you need a more extreme version of this prank, check out this product from ThinkGeek: http://www.thinkgeek.com/gadgets/electronic/8c52/. This version is set to random periods between beeps and designed just for this prank.</p>
<h3>Materials:</h3>
<ul>
<li>Stopwatch or other small device that can beep routinely</li>
<li>ThinkGeek Annoy-A-Tron</li>
</ul>
<h2>Auricular Feedback</h2>
<p>All you need for this prank is a stereo line-in cable. That&#8217;s the cable you use to connect your speakers to your computer. More specifically, it&#8217;s a cable with a 1/8in male headphone jack on each side. Most speakers come with one or several of these cables. Attach one end to the line-in or microphone jack on your coworker&#8217;s computer. These jacks usually have icons to represent what they are. Next, plug the other end of the cable into the speaker-out jack on your computer. Basically, the sound from your computer will be played on their computer as microphone or line-in input.<br />
You may need to unmute or adjust the volume of their microphone/line-in while they are away. To start, set your volume very low. You don&#8217;t want to make them suspicious too soon. Make sure that no unexpected noise plays on your computer &#8211; it blows your cover quickly when your favorite mp3 starts playing on their computer. Instead, play small annoying sounds, like insect buzzes, audio tests (http://www.bbc.co.uk/wiltshire/audio/mosquito_sound.mp3, the Mosquito, a sound file with frequency that only certain ages can hear), or weird beeps and boops from Flash game sites with sample sounds. Don&#8217;t overdo it, and gradually increase either the volume or the obnoxiousness of the sounds as the day progresses for maximum effect.</p>
<h3>Materials:</h3>
<ul>
<li>Speaker Line-In cable</li>
</ul>
<p>Those are just a few for now, but check back in later for more!</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/04/21/tech-pranks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.bbc.co.uk/wiltshire/audio/mosquito_sound.mp3" length="605952" type="audio/mpeg" />
		</item>
		<item>
		<title>Populating a Combo-box in PHP Dynamically from MySQL</title>
		<link>http://www.internaldrive.com/2009/03/31/populating-a-combo-box-in-php-dynamically-from-mysql/</link>
		<comments>http://www.internaldrive.com/2009/03/31/populating-a-combo-box-in-php-dynamically-from-mysql/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 16:30:59 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[combo-box]]></category>
		<category><![CDATA[drop-down box]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=21898</guid>
		<description><![CDATA[For this article, let&#8217;s pretend you have the following database table. There are two columns (I&#8217;m separating the fields with commas for readability), Item and Price:
Cheese Pizza, 1.00
Pepporoni Pizza, 1.50
Sausage Pizza, 1.50
Cheese Calzone, 1.50
Ham Calzone, 2.00
What if you want to populate a combo-box with your possible options? We can write php that generates a drop-down [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>For this article, let&#8217;s pretend you have the following database table. There are two columns (I&#8217;m separating the fields with commas for readability), Item and Price:</p>
<p>Cheese Pizza, 1.00<br />
Pepporoni Pizza, 1.50<br />
Sausage Pizza, 1.50<br />
Cheese Calzone, 1.50<br />
Ham Calzone, 2.00</p>
<p>What if you want to populate a combo-box with your possible options? We can write php that generates a drop-down box that has five item choices in it, based on our table above. Here is the sample code:</p>
<pre>&lt;?php

  // Connect to the database
  mysql_connect("localhost", "user", "password") or die(mysql_error());
  mysql_select_db("name") or die(mysql_error());

  // Has the form been submitted?
  if (isset($_POST['item'])) {

    // The form has been submitted, query results
    $queryitem = "SELECT * FROM table WHERE item = '".$_POST['item']."';";

    // Successful query?
    if($result = mysql_query($queryitem))  {

      // More than 0 results returned?
      if($success = mysql_num_rows($result) &gt; 0) {

        // For each result returned, display it
        while ($row = mysql_fetch_array($result)) echo $row[serial];
      }
      // Otherwise, no results, tell user
      else { echo "No results found."; }
    }
    // Error connecting? Tell user
    else { echo "Failed to connect to database."; }
  }
  // The form has NOT been submitted, so show the form instead of results
  else {

    // Create the form, post to the same file
    echo "&lt;form method='post' action='example.php'&gt;";

    // Form a query to populate the combo-box
    $queryitem = "SELECT DISTINCT item FROM table;";

    // Successful query?
    if($result = mysql_query($queryitem))  {

      // If there are results returned, prepare combo-box
      if($success = mysql_num_rows($result) &gt; 0) {
        // Start combo-box
        echo "&lt;select name='item'&gt;\n";
        echo "&lt;option&gt;-- Select Item --&lt;/option&gt;\n";

        // For each item in the results...
        while ($row = mysql_fetch_array($result))
          // Add a new option to the combo-box
          echo "&lt;option value='$row[item]'&gt;$row[item]&lt;/option&gt;\n";

        // End the combo-box
        echo "&lt;/select&gt;\n";
      }
      // No results found in the database
      else { echo "No results found."; }
    }
    // Error in the database
    else { echo "Failed to connect to database."; }

    // Add a submit button to the form
    echo "&lt;input type='submit' value='Submit' /&gt;&lt;/form&gt;";
  }
?&gt;</pre>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/03/31/populating-a-combo-box-in-php-dynamically-from-mysql/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A few helpful string and array PHP functions</title>
		<link>http://www.internaldrive.com/2009/03/26/a-few-helpful-string-and-array-php-functions/</link>
		<comments>http://www.internaldrive.com/2009/03/26/a-few-helpful-string-and-array-php-functions/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 21:32:10 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[strings]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=21685</guid>
		<description><![CDATA[I&#8217;ve been working a great deal with vBulletin, our forums system, and in doing so have had to brush on my PHP. Through the course of preparing the system for the summer I&#8217;ve come across a few PHP functions that I was not aware. Here&#8217;s a few that you may not know about:
implode: takes an [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>I&#8217;ve been working a great deal with vBulletin, our forums system, and in doing so have had to brush on my PHP. Through the course of preparing the system for the summer I&#8217;ve come across a few PHP functions that I was not aware. Here&#8217;s a few that you may not know about:</p>
<p><strong><a href="http://php.net/implode">implode</a></strong>: takes an array of strings and concatenates them, using $glue as a separator.</p>
<p style="padding-left: 30px;"><strong>Example:</strong> <em>string implode (string $glue, array $pieces)</em><br />
$before = array(&#8217;one&#8217;, &#8216;two&#8217;, &#8216;three&#8217;);<br />
$after = implode(&#8221;,&#8221;, $before);<br />
echo $after;</p>
<p style="padding-left: 30px;"><strong>Produces:</strong><em>one,two,three</em></p>
<p><strong><a href="http://php.net/explode">explode</a></strong>: does the exact opposite of implode &#8211; it takes a delimiter separated string and transforms it into an array.</p>
<p style="padding-left: 30px;"><strong>Example:</strong> <em>array explode (string $delimiter, string $string [, int $limit= -1])</em><br />
$before = &#8220;one,two,three&#8221;;<br />
$after = explode(&#8221;,&#8221;, $before);<br />
var_dump $after;</p>
<p style="padding-left: 30px;"><strong>Produces:</strong><br />
array(&#8217;one&#8217;, &#8216;two&#8217;, &#8216;three&#8217;)</p>
<p><strong><a href="http://php.net/var_dump">var_dump</a></strong>: unlike a typical echo, which will just print &#8220;Array&#8221; for arrays, var_dump will traverse and print the contents of the array.</p>
<p style="padding-left: 30px;"><strong>Example:</strong> <em>void var_dump (mixed $expression [, mixed $expression [,  $...  ]])</em><br />
$before = &#8220;one,two,three&#8221;;<br />
var_dump $before;</p>
<p style="padding-left: 30px;"><strong>Produces:</strong><br />
array(3) {<br />
[0]=&gt;string(1) &#8220;one&#8221;<br />
[1]=&gt;string(1) &#8220;two&#8221;<br />
[2]=&gt;string(1) &#8220;three&#8221;<br />
}</p>
<p>Of course, if you use PHP any more than casually then you already know these functions. But if you frequently jump around among web technologies you might find these useful.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/03/26/a-few-helpful-string-and-array-php-functions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making a Flex MP3 Player</title>
		<link>http://www.internaldrive.com/2009/03/11/making-a-flex-mp3-player/</link>
		<comments>http://www.internaldrive.com/2009/03/11/making-a-flex-mp3-player/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 20:28:30 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[event listener]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[mouselistener]]></category>
		<category><![CDATA[mp3 player]]></category>
		<category><![CDATA[mp3s]]></category>
		<category><![CDATA[progress bar]]></category>
		<category><![CDATA[progressbar]]></category>
		<category><![CDATA[simple mp3]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[visualizer]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=21318</guid>
		<description><![CDATA[This entry I&#8217;ll be showcasing a simple MP3 player written in Adobe Flex. Full source code is available here.
Also included in this project is a wonderful Flex visualizer written by Ben Stucki. The player loads an MP3, either local or remote. An event listener then calls a function when loading is complete that will pull [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>This entry I&#8217;ll be showcasing a simple MP3 player written in Adobe Flex. Full source code is available <a href="http://forum.internaldrive.com/files/vlog/FlexMp3/Mp3Player.zip">here</a>.</p>
<p>Also included in this project is a <a href="http://blog.benstucki.net/?id=18">wonderful Flex visualizer</a> written by Ben Stucki. The player loads an MP3, either local or remote. An event listener then calls a function when loading is complete that will pull ID3 tag information. In this project I&#8217;m only pulling the Title, Artist, and Album tags, but you can pull any associated tag you need. We also create a visualizer component and link it to a playing sound channel, which produces the lovely visualizer.</p>
<p>You can also load remote MP3s just as easily (the default MP3 is local). Simply paste the URL for an mp3 into the text box and then hit the play button.</p>
<p>In addition I&#8217;ve incorporated a rather hackish Flex ProgressBar as a &#8220;seek&#8221; bar. The percentage of play progress is calculated and then applied to the progress bar regularly, and a MouseListener is placed on the progress bar that allows the user to click at various points along the bar. The coordinates of the mouse click are then translated into a percentage of the song length. The song is then stopped and play is started from the new location.</p>
<p><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="Mp3Player" width="100%" height="100%" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"><param name="movie" value="http://forum.internaldrive.com/files/vlog/FlexMp3/Mp3Player.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="allowScriptAccess" value="sameDomain" /><embed src="http://forum.internaldrive.com/files/vlog/FlexMp3/Mp3Player.swf" quality="high" bgcolor="#ffffff" width="100%" height="100%" name="Mp3Player" align="middle" play="true" loop="false" quality="high" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object></p>
<p>The music sample used is from <a href="http://www.wired.com/wired/archive/12.11/sample.html">Wired&#8217;s Creative Commons CD</a>. Tracks from this album can also be used to test the remote playing functionality.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/03/11/making-a-flex-mp3-player/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Changing the default Flash cursor</title>
		<link>http://www.internaldrive.com/2009/03/07/changing-the-default-flash-cursor/</link>
		<comments>http://www.internaldrive.com/2009/03/07/changing-the-default-flash-cursor/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 16:46:23 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=21306</guid>
		<description><![CDATA[Ever wanted to use a custom animated cursor in your Flash project? This video tutorial will show you how to do so via Actionscript. Click here for the source code.


]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Ever wanted to use a custom animated cursor in your Flash project? This video tutorial will show you how to do so via Actionscript. Click <a href="http://forum.internaldrive.com/files/vlog/VLog2FlashMouse_src.zip">here</a> for the source code.</p>
<p><object id="csSWF" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="498" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"><param name="src" value="http://forum.internaldrive.com/files/vlog/Cursor_controller.swf"/><param name="bgcolor" value="#1a1a1a"/><param name="quality" value="best"/><param name="allowScriptAccess" value="always"/><param name="allowFullScreen" value="true"/><param name="scale" value="showall"/><param name="flashVars" value="autostart=false"/><embed name="csSWF" src="http://forum.internaldrive.com/files/vlog/Cursor_controller.swf" width="640" height="498" bgcolor="#1a1a1a" quality="best" allowScriptAccess="always" allowFullScreen="true" scale="showall" flashVars="autostart=false&#038;color=0x1A1A1A,0x1A1A1A" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object></p>
<p></code></p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/03/07/changing-the-default-flash-cursor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WhackIt: Flash Game Video Tutorial</title>
		<link>http://www.internaldrive.com/2009/03/04/whackit-flash-game-video-tutorial/</link>
		<comments>http://www.internaldrive.com/2009/03/04/whackit-flash-game-video-tutorial/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 16:33:26 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[video tutorial]]></category>
		<category><![CDATA[whack-a-mole]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=21300</guid>
		<description><![CDATA[Here&#8217;s another Flash video tutorial. This time we&#8217;ll be focusing on a &#8220;Whack-a-mole&#8221; type Flash game. Click here to download the accompanying source code.


]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Here&#8217;s another Flash video tutorial. This time we&#8217;ll be focusing on a &#8220;Whack-a-mole&#8221; type Flash game. Click <a href="http://forum.internaldrive.com/files/vlog/VLog3WhackIt_src.zip">here</a> to download the accompanying source code.</p>
<p><object id="csSWF" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="498" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"><param name="src" value="http://forum.internaldrive.com/files/vlog/WhackIt_controller.swf"/><param name="bgcolor" value="#1a1a1a"/><param name="quality" value="best"/><param name="allowScriptAccess" value="always"/><param name="allowFullScreen" value="true"/><param name="scale" value="showall"/><param name="flashVars" value="autostart=false"/><embed name="csSWF" src="http://forum.internaldrive.com/files/vlog/WhackIt_controller.swf" width="640" height="498" bgcolor="#1a1a1a" quality="best" allowScriptAccess="always" allowFullScreen="true" scale="showall" flashVars="autostart=false&#038;color=0x1A1A1A,0x1A1A1A" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object></p>
<p></code></p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/03/04/whackit-flash-game-video-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video Tutorial: Creating a Defender Flash Game</title>
		<link>http://www.internaldrive.com/2009/02/25/video-tutorial-creating-a-defender-flash-game/</link>
		<comments>http://www.internaldrive.com/2009/02/25/video-tutorial-creating-a-defender-flash-game/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 17:35:16 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[defender]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=21144</guid>
		<description><![CDATA[I&#8217;ve created a video tutorial breaking down in 10 minutes how to make a Flash defender game. If you&#8217;d like to check out the game and source, they are also available. 
Play the game: http://forum.internaldrive.com/files/vlog/Yadder.swf
Download the source: http://forum.internaldrive.com/files/vlog/VLog1Yadder_src.zip

]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>I&#8217;ve created a video tutorial breaking down in 10 minutes how to make a Flash defender game. If you&#8217;d like to check out the game and source, they are also available. </p>
<p>Play the game: http://forum.internaldrive.com/files/vlog/Yadder.swf<br />
Download the source: http://forum.internaldrive.com/files/vlog/VLog1Yadder_src.zip</p>
<p><embed name="csSWF" src="http://forum.internaldrive.com/files/vlog/Yadder_controller.swf" width="640" height="498" bgcolor="#1a1a1a" quality="best" allowScriptAccess="always" allowFullScreen="true" scale="showall" flashVars="autostart=false&#038;color=0x000000,0x000000" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/02/25/video-tutorial-creating-a-defender-flash-game/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://forum.internaldrive.com/files/vlog/VLog1Yadder.mp4" length="25929326" type="video/mp4" />
		</item>
	</channel>
</rss>
<!-- loadstorm-27143 -->