<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>I am currently a student at the University of Washington working on a B.S. in Computing and Software System. I also work as a web programmer at a small company called Efellemedia.
I grew up in Tacoma, but currently live in the beautiful city of Seattle. I enjoy listening to music, drinking coffee, and programming. Now if that’s not proof I live in Seattle, I don’t know what is.
I originally graduated University of Washington with a B.S. in Botany at the end of 2004. From there I tried for months to get a job in the plant science field and finally landed a job at Molbak’s, which is a large gardening store in Woodinville. I was the landscaper there for about a year. It wasn’t a bad job cause I got to be outside all day and I was the fittest I have ever been in my entire life.Eventually I decided I wasn’t satisfied with my current position and wanted to make my hobby of programming a full time career.  So here I am. On my computer all day, drinking coffee, and listening to good music.Programming Under The Influence was a name I came up with a few days ago, because I was programming under the influence of some pain medicine, which I had taken to get rid of a headache. I felt really good,  my headache was gone, and I got a lot of work done that day. Therefore, I decided to make this a personal blog of existing site mentions, my upcoming sites, and cool tricks I found along the way. And no, Percocet is *not* a trick to creating cool sites. It’s good for headaches though :p.



var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-7820366-4");
pageTracker._trackPageview();
} catch(err) {}</description><title>Programmed Under The Influence</title><generator>Tumblr (3.0; @skrolikowski)</generator><link>http://programmedundertheinfluence.com/</link><item><title>"One guy thought he was invisible, the other thought he could fly. Both were wrong. - Steven Seagal"</title><description>“One guy thought he was invisible, the other thought he could fly. Both were wrong. - Steven Seagal”</description><link>http://programmedundertheinfluence.com/post/13706645048</link><guid>http://programmedundertheinfluence.com/post/13706645048</guid><pubDate>Sat, 03 Dec 2011 18:01:57 -0800</pubDate></item><item><title>Replacing Placeholders in PHP</title><description>Ran across a neat little function in PHP for replacing multiple placeholder instances within a string.&lt;br/&gt;&lt;u&gt;Here’s an example&lt;/u&gt;:
&lt;pre&gt;&lt;code&gt;
$string = "&lt;strong&gt;##title##&lt;/strong&gt;&lt;p&gt;##some_text##&lt;/p&gt;";
&lt;/code&gt;&lt;/pre&gt;


&lt;u&gt;Here’s the PHP&lt;/u&gt;:
&lt;pre&gt;&lt;code&gt;
echo strtr($string,
  array(
    '##title##' =&gt; "The Spice...",
    '##some_text##' =&gt; "Will flow!!!"
  )
);
&lt;/code&gt;&lt;/pre&gt;


&lt;u&gt;Here’s the result&lt;/u&gt;:&lt;br/&gt;&lt;strong&gt;The Spice…&lt;/strong&gt;&lt;p&gt;Will flow!!!&lt;/p&gt;</description><link>http://programmedundertheinfluence.com/post/13706196498</link><guid>http://programmedundertheinfluence.com/post/13706196498</guid><pubDate>Sat, 03 Dec 2011 17:51:35 -0800</pubDate><category>php</category><category>replace</category><category>placeholder</category><category>function</category></item><item><title>Converting Non-English Characters in PHP</title><description>&lt;p&gt;In my previous post, &lt;a href="http://programmedundertheinfluence.com/post/13503155299/remove-non-english-characters-php" target="_blank"&gt;Removing Non-English Characters in PHP&lt;/a&gt;, I provided a way to remove non-english characters, but I found another neat trick to convert these characters into a close ASCII equivalent.

Here’s the code:
&lt;code&gt;
&lt;pre&gt;function unaccent($string) {
    if (strpos($string = htmlentities($string, ENT_QUOTES, 'UTF-8'), '&amp;') !== false) {
        $string = html_entity_decode(preg_replace('~&amp;([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|tilde|uml);~i', '$1', $string), ENT_QUOTES, 'UTF-8');
    }

    return $string;
}&lt;/pre&gt;&lt;/code&gt;

…and here’s the &lt;a href="http://stackoverflow.com/questions/158241/php-replace-umlauts-with-closest-7-bit-ascii-equivalent-in-an-utf-8-string#answer-5950598" target="_blank"&gt;source&lt;/a&gt;.&lt;/p&gt;</description><link>http://programmedundertheinfluence.com/post/13505554210</link><guid>http://programmedundertheinfluence.com/post/13505554210</guid><pubDate>Tue, 29 Nov 2011 10:02:17 -0800</pubDate><category>php</category><category>ascii</category><category>utf-8</category><category>replace</category></item><item><title>Removing Non-English Characters in PHP</title><description>&lt;p&gt;Why would you want to do this, you say?&lt;/p&gt;

&lt;p&gt;Well, I found out the other day a payment processor we use (&lt;a href="http://www.authorize.net/" target="_blank"&gt;Authorize.net&lt;/a&gt;) at the company I work at doesn’t allow for non-english characters and in return, throws a cryptic error.&lt;/p&gt;

&lt;p&gt;Here’s the error:&lt;br/&gt;&lt;b&gt;E00003&lt;/b&gt; - Invalid character in the given encoding. Line 15, position 54.&lt;/p&gt;

&lt;p&gt;Here’s the trick:&lt;br/&gt;&lt;code&gt;$str = preg_replace('/[^\00-\255]+/u', '', $str);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;br/&gt;
…and here’s my &lt;a href="http://stackoverflow.com/questions/3654879/remove-non-english-characters-php" target="_blank"&gt;sources&lt;/a&gt; and &lt;a href="http://community.developer.authorize.net/t5/Integration-and-Testing/C-AIM-code-and-non-english-character/td-p/1132" target="_blank"&gt;#2&lt;/a&gt;.&lt;/p&gt;</description><link>http://programmedundertheinfluence.com/post/13503155299</link><guid>http://programmedundertheinfluence.com/post/13503155299</guid><pubDate>Tue, 29 Nov 2011 08:32:00 -0800</pubDate><category>php</category><category>coding</category><category>preg_replace</category><category>replace</category><category>string</category><category>authorize.net</category><category>payment</category></item><item><title>Creating a forum/chat room hybrid system</title><description>&lt;p&gt;I’ve been asked a few times so far to create a chat room for one of my sites. Now even though I think this is an interesting request, I find that chat rooms have become a thing of the past, which have been taken up by the older Internet crowd and (sadly) cyber-predators (no, not like the one Schwarzenegger fought).&lt;/p&gt;

&lt;p&gt;I did some thinking and a friend of mine helped me come up with an idea to create a forum/chat room hybrid. It would have the visual &amp; functional qualities of a forum, but would be updated dynamically using sort of what you now find on &lt;a href="http://twitter.com/#search?q=seattle" title="Twitter's real-time search results" target="_blank"&gt;Twitter’s real-time search results&lt;/a&gt; where you are notified of new posts on a timely basis. I’m not going to go into very much detail cause I had to make it work for my site specifically, but I’ll give you an idea on how it works so you can take it in any direction you want to.&lt;/p&gt;

&lt;p&gt;What you’ll need… HTML, PHP, jQuery, and a MySQL database&lt;/p&gt;

&lt;p&gt;First thing first, let’s see a quick look at what the HTML code will look like (again, this is really basic). *Note: we are setting a session to keep track of when the user first got to the page so we aren’t loading posts that aren’t “new”:&lt;/p&gt;

&lt;pre style="border: 1px solid #353535; background-color: #F9F9F9; padding: 10px; font-size: 11px;"&gt;
&lt;?php $_SESSION['last_refresh'] = date('Y-m-d H:i:s'); ?&gt;

&lt;div id="new_posts_msg" style="display: none;"&gt; &lt;/div&gt;
&lt;div id="forum_posts"&gt;
    &lt;div class="forum_post"&gt;First!&lt;/div&gt;
    &lt;div class="forum_post"&gt;Second post!&lt;/div&gt;
    &lt;div class="forum_post"&gt;Third!&lt;/div&gt;
&lt;/div&gt;
&lt;/pre&gt;

&lt;p&gt;Next, we need to set up a timer that will kick off the &lt;i&gt;update&lt;/i&gt; function (which fires when the document is ready) and have it run every so often (mine fires every 20 seconds):&lt;/p&gt;

&lt;pre style="border: 1px solid #353535; background-color: #F9F9F9; padding: 10px; font-size: 11px;"&gt;
$(document).ready(function() {
    setTimeout('checkForNewPosts()', 20000);
}
&lt;/pre&gt;

&lt;p&gt;Now let’s take a look at the function that will call a background script to check for new posts and display a button telling the user that there are new posts:&lt;/p&gt;

&lt;pre style="border: 1px solid #353535; background-color: #F9F9F9; padding: 10px; font-size: 11px;"&gt;
function checkForNewPosts() {
    $.post('checkForNewPosts.php',
        function(data) {
            if (data &gt; 0) {
	        $('#new_posts_msg')
                .html('&lt;button type="button" onclick="loadNewPosts()"&gt;
                  New posts! Click to load them.&lt;/button&gt;')
                .fadeIn('slow');
	    }
        });
    
    // Check again in 20 seconds
    setTimeout('checkForNewPosts()', 20000);
}
&lt;/pre&gt;

&lt;p&gt;Let’s take a look at what’s happening on the “back-end” (or the &lt;i&gt;checkForNewPosts.php&lt;/i&gt; file). Using the session we set from last time, we will select any “new” posts that weren’t loaded when the page was first loaded. The result is then sent back to the javascript function to display the “new post” notification button if any new posts have been added:&lt;/p&gt;

&lt;pre style="border: 1px solid #353535; background-color: #F9F9F9; padding: 10px; font-size: 11px;"&gt;
&lt;?php // check for new posts in our `forum_posts` table
    $query = "SELECT COUNT(*) AS new_post_count
        FROM forum_posts
        WHERE forum_posts.added
          BETWEEN '" . $_SESSION['last_refresh'] . "' AND NOW()";
    $result = $this-&gt;query($query);
    
    // Return to display notification
    echo $result[0]['alias']['new_post_count'];
?&gt;
&lt;/pre&gt;

&lt;p&gt;If you noticed before, the “new post” notification button had an onclick function called &lt;i&gt;loadNewPosts()&lt;/i&gt;. This is shown below and is used to load all the new posts that were found:&lt;/p&gt;

&lt;pre style="border: 1px solid #353535; background-color: #F9F9F9; padding: 10px; font-size: 11px;"&gt;
function loadNewPosts() {
    $.post('loadNewPosts.php',
        function(data) {
            $('#new_posts_msg').html('').hide(); // Hide the button
            
            // Display new posts
            $('#forum_posts').find('.forum_post:last').after(data);
        });
}
&lt;/pre&gt;

&lt;p&gt;Finally, the &lt;i&gt;loadNewPosts.php&lt;/i&gt; file is responsible for retrieving all the new posts and adding them after the latest post already loaded:&lt;/p&gt;

&lt;pre style="border: 1px solid #353535; background-color: #F9F9F9; padding: 10px; font-size: 11px;"&gt;
&lt;?php
    $query = "SELECT *
        FROM forum_posts
        WHERE forum_posts.added
          BETWEEN '" . $_SESSION['last_refresh'] . "' AND NOW()";
    $result = $this-&gt;query($query);
    
    $new_posts = "";
    foreach ($result as $row) {
        $new_posts .= "&lt;div class="forum_post"&gt;" .
            $row['forum_posts']['post'] .
            &lt;/div&gt;";
    }
    
    // Return to display new posts on web page
    echo $new_posts;
?&gt;
&lt;/pre&gt;

&lt;p&gt;I hope that all made sense and helps you in your endeavors to make a dynamically-tubular website. For a working demo, please check out an active thread at: &lt;a href="http://onelinerhyme.com/forum/room/general-discussion" title="One Line Rhyme :: Forums" target="_blank"&gt;One Line Rhyme :: Forums&lt;/a&gt;&lt;/p&gt;</description><link>http://programmedundertheinfluence.com/post/197783555</link><guid>http://programmedundertheinfluence.com/post/197783555</guid><pubDate>Sat, 26 Sep 2009 15:57:00 -0700</pubDate><category>chat</category><category>create</category><category>forum</category><category>hybrid</category><category>chat room</category><category>jquery</category><category>php</category><category>mysql</category><category>website</category><category>feature</category></item><item><title>I was working on the Account Settings page for one of my...</title><description>&lt;img src="http://26.media.tumblr.com/tumblr_kpfolq9btQ1qzj5klo1_400.png"/&gt;&lt;br/&gt; imagecopyresized - grainy, but quick&lt;br/&gt;&lt;br/&gt; &lt;img src="http://27.media.tumblr.com/tumblr_kpfolq9btQ1qzj5klo2_400.png"/&gt;&lt;br/&gt; imagecopyresampled - smooth, but slow&lt;br/&gt;&lt;br/&gt; &lt;p&gt;I was working on the Account Settings page for one of my personal sites today and I noticed that the resized images I was uploading for test purposes were very pixelated. Then I noticed that my image resizing class was using imagecopyresized to resize the images. I decided to do some research and found that imagecopyresized is quick and dirty, while imagecopyresampled is more CPU intensive, but keeps some of quality making the image smoother and clearer in the end. Luckily for me I don’t allow larger than 50K uploads on my site so I’m now using imagecopyresampled.&lt;/p&gt;</description><link>http://programmedundertheinfluence.com/post/179439187</link><guid>http://programmedundertheinfluence.com/post/179439187</guid><pubDate>Thu, 03 Sep 2009 23:27:26 -0700</pubDate><category>php</category><category>image</category><category>file</category><category>upload</category><category>imagecopyresized</category><category>imagecopyresampled</category></item><item><title>Parsing RSS feeds using SimpleXML</title><description>&lt;p&gt;I’m was working with &lt;a href="http://www.last.fm/api" target="_blank"&gt;Last.fm’s API&lt;/a&gt; service to post user’s recent tracks on one of my sites. I wanted a lighter solution to using their REST Request method so I opted to use their RSS feeds instead. In the past I used either &lt;a href="http://magpierss.sourceforge.net/" target="_blank"&gt;Magpie&lt;/a&gt; or &lt;a href="http://simplepie.org/" target="_blank"&gt;SimplePie&lt;/a&gt; to parse the RSS for easy access, but I didn’t want the overhead of both these services so I did some research and found something of use courtesy of Stuart Herbert’s article, “&lt;a href="http://blog.stuartherbert.com/php/2007/01/07/using-simplexml-to-parse-rss-feeds/" target="_blank"&gt;Using SimpleXML To Parse RSS Feeds&lt;/a&gt;.”&lt;/p&gt;

&lt;p&gt;I’ll give a brief tutorial on how I used Stuart’s tutorial to display my 10 most recent tracks from Last.fm:&lt;/p&gt;

&lt;div style="background:#353535;padding:10px;"&gt;&lt;code&gt;&lt;pre&gt;&lt;small&gt;
// Get the RSS URL and plug in your ~username~
$lastfm_feed = "http://ws.audioscrobbler.com/1.0/user/~username~/recenttracks.rss";

// Turn the feed into a string and load it using PHP's simpleXML function
$raw_feed = file_get_contents($lastfm_feed);
$xml = simplexml_load_string($raw_feed);

// Next throw the results into a foreach loop to display the results
// I'll just display all the values you can print out
foreach ($xml-&gt;channel-&gt;item as $item) {
    echo $item-&gt;title; // Track title
    echo $item-&gt;link; // Link back to the track on Last.fm
    echo $item-&gt;pubDate; // Date the track was played
    echo $item-&gt;guid; // Unique identifier
    echo $item-&gt;description; // Links back to the artist's page
}
&lt;/small&gt;&lt;/pre&gt;&lt;/code&gt;&lt;/div&gt;</description><link>http://programmedundertheinfluence.com/post/174973556</link><guid>http://programmedundertheinfluence.com/post/174973556</guid><pubDate>Sat, 29 Aug 2009 14:58:08 -0700</pubDate><category>simplexml</category><category>php</category><category>rss</category><category>feed</category><category>parse</category><category>last.fm</category><category>api</category></item><item><title>Pollacio.us is here!!</title><description>&lt;p&gt;My newest edition has arrived….&lt;/p&gt;
&lt;p&gt;&lt;a href="http://pollacio.us" title="Pollacio.us" target="_blank"&gt;&lt;img src="http://pollacio.us/public/img/pollacious.png" alt="Pollacio.us Logo" style="background: #343F47;"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://pollacio.us" title="Pollacio.us" target="_blank"&gt;Pollacio.us&lt;/a&gt; is a website with a simple concept. You create a survey, invite your friends to vote, and watch as the results come in. Democracy at it’s best, yea yea!!&lt;/p&gt;
&lt;p&gt;Have you ever had to make plans with a group of friends and never know what to do? &lt;a href="http://pollacio.us" title="Pollacio.us" target="_blank"&gt;Pollacio.us&lt;/a&gt; has the tools to help you and your friends decide on what to do as a group.&lt;/p&gt;
&lt;p&gt;The site has a comfortable feel (logo courtesy of &lt;a href="http://twitter.com/sxtxixtxcxh" title="Diva" target="_blank"&gt;sxtxixtxcxh&lt;/a&gt;), it’s easy to use (I hope), and most importantly is free to join! So please &lt;a href="http://pollacio.us/account/register" title="Register" target="_blank"&gt;register&lt;/a&gt; and start creating surveys :D&lt;/p&gt;</description><link>http://programmedundertheinfluence.com/post/166592981</link><guid>http://programmedundertheinfluence.com/post/166592981</guid><pubDate>Wed, 19 Aug 2009 09:26:00 -0700</pubDate><category>pollacious</category><category>survey</category><category>website</category><category>new</category></item><item><title>Converting ZIP to State Abbr. (using PHP)</title><description>&lt;a href="http://www.pakt.com/pakt/?id=cab1ae45fb98106041b974013a93bdfd&amp;t=PHP_convert_ZIP_to_State"&gt;Converting ZIP to State Abbr. (using PHP)&lt;/a&gt;: &lt;p&gt;Cool “little” script for converting a 5 digit ZIP code to a 2 letter state abbreviation.&lt;/p&gt;</description><link>http://programmedundertheinfluence.com/post/163108061</link><guid>http://programmedundertheinfluence.com/post/163108061</guid><pubDate>Fri, 14 Aug 2009 15:48:22 -0700</pubDate><category>zip</category><category>state</category><category>abbreviation</category><category>abbr</category><category>php</category><category>convert</category><category>conversion</category></item><item><title>Dawn of the Surprise Squirrel!!
(Photo from the movie: Dawn of...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_koc30qzTMa1qzj5klo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Dawn of the Surprise Squirrel!!&lt;/p&gt;
&lt;small&gt;&lt;em&gt;(Photo from the movie: Dawn of the Dead - 2004)&lt;/em&gt;&lt;/small&gt;</description><link>http://programmedundertheinfluence.com/post/162300853</link><guid>http://programmedundertheinfluence.com/post/162300853</guid><pubDate>Thu, 13 Aug 2009 14:14:00 -0700</pubDate><category>dawn of the dead</category><category>funny</category><category>photo</category><category>squirrel</category><category>surprise</category><category>zombies</category></item><item><title>Bike Crash (Surprise) Squirrel!!
(Original image from:...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_kobxpj4OIF1qzj5klo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Bike Crash (Surprise) Squirrel!!&lt;/p&gt;
&lt;small&gt;&lt;em&gt;(Original image from: &lt;a href="http://www.rofl.name/" target="_blank"&gt;http://www.rofl.name/&lt;/a&gt;)&lt;/em&gt;&lt;/small&gt;</description><link>http://programmedundertheinfluence.com/post/162233106</link><guid>http://programmedundertheinfluence.com/post/162233106</guid><pubDate>Thu, 13 Aug 2009 12:20:00 -0700</pubDate><category>own</category><category>owned</category><category>surprise</category><category>squirrel</category><category>funny</category><category>photo</category><category>bike</category></item><item><title>Nuclear (Surprise) Squirrel!!
(Original image from:...</title><description>&lt;img src="http://29.media.tumblr.com/tumblr_kobx9vod3E1qzj5klo1_400.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Nuclear (Surprise) Squirrel!!&lt;/p&gt;
&lt;small&gt;&lt;em&gt;(Original image from: &lt;a href="http://science.howstuffworks.com/" target="_blank"&gt;http://science.howstuffworks.com/&lt;/a&gt;)&lt;/em&gt;&lt;/small&gt;</description><link>http://programmedundertheinfluence.com/post/162227592</link><guid>http://programmedundertheinfluence.com/post/162227592</guid><pubDate>Thu, 13 Aug 2009 12:10:00 -0700</pubDate><category>nuclear</category><category>fallout</category><category>surprise</category><category>squirrel</category><category>photo</category><category>funny</category></item><item><title>Surprise Squirrel!! (at least that’s what I call...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_kobx7vJn5N1qzj5klo1_250.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Surprise Squirrel!! (at least that’s what I call him)&lt;/p&gt;
&lt;small&gt;&lt;em&gt;(Source: &lt;a href="http://www.telegraph.co.uk/news/newstopics/howaboutthat/6018173/Squirrel-is-surprise-star-of-holiday-photo.html" target="_blank"&gt;http://www.telegraph.co.uk/news/newstopics/howaboutthat/6018173/Squirrel-is-surprise-star-of-holiday-photo.html&lt;/a&gt;)&lt;/em&gt;&lt;/small&gt;</description><link>http://programmedundertheinfluence.com/post/162226902</link><guid>http://programmedundertheinfluence.com/post/162226902</guid><pubDate>Thu, 13 Aug 2009 12:09:00 -0700</pubDate><category>surprise</category><category>squirrel</category><category>internet</category><category>meme</category></item><item><title>5 flavors of voting. Choose which one best suits your survey.</title><description>&lt;img src="http://28.media.tumblr.com/NzFjB4XIAqycdivvcowLEOKho1_500.png"/&gt;&lt;br/&gt; Simple - choose one&lt;br/&gt;&lt;br/&gt; &lt;img src="http://24.media.tumblr.com/NzFjB4XIAqycdivvcowLEOKho2_500.png"/&gt;&lt;br/&gt; Ranked - order options from good to bad&lt;br/&gt;&lt;br/&gt; &lt;img src="http://25.media.tumblr.com/NzFjB4XIAqycdivvcowLEOKho3_500.png"/&gt;&lt;br/&gt; Range - score each option from 0 to 5&lt;br/&gt;&lt;br/&gt; &lt;img src="http://25.media.tumblr.com/NzFjB4XIAqycdivvcowLEOKho4_500.png"/&gt;&lt;br/&gt; Approval - choose all options you like&lt;br/&gt;&lt;br/&gt; &lt;img src="http://30.media.tumblr.com/NzFjB4XIAqycdivvcowLEOKho5_500.png"/&gt;&lt;br/&gt; Weighted - divvy up 5 pts to all options&lt;br/&gt;&lt;br/&gt; &lt;p&gt;5 flavors of voting. Choose which one best suits your survey.&lt;/p&gt;</description><link>http://programmedundertheinfluence.com/post/159617265</link><guid>http://programmedundertheinfluence.com/post/159617265</guid><pubDate>Sun, 09 Aug 2009 23:02:54 -0700</pubDate></item><item><title>Run out of options? No problem, click ‘Another...</title><description>&lt;img src="http://27.media.tumblr.com/NzFjB4XIAqybqz5iArSmnbiOo1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Run out of options? No problem, click ‘Another Option?’&lt;/p&gt;
&lt;p&gt;This jQuery plugin lets you easily create new fields with the click of a button (granted you are okay with using &lt;table&gt;s.) It’s easy to integrate and fairly customizable.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://deepliquid.com/content/Appendo.html" target="_blank"&gt;Appendo&lt;/a&gt; courtesy of &lt;a href="http://deepliquid.com/blog/" target="_blank"&gt;Deep Liquid&lt;/a&gt;&lt;/p&gt;</description><link>http://programmedundertheinfluence.com/post/159608409</link><guid>http://programmedundertheinfluence.com/post/159608409</guid><pubDate>Sun, 09 Aug 2009 22:45:00 -0700</pubDate><category>php,</category><category>options</category><category>form</category><category>jquery</category><category>appendo</category></item><item><title>Finishing up the survey voting and results pages.
Basically this...</title><description>&lt;img src="http://25.media.tumblr.com/NzFjB4XIAqxliovlpCLAQNmbo1_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://29.media.tumblr.com/NzFjB4XIAqxliovlpCLAQNmbo2_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;Finishing up the survey voting and results pages.&lt;/p&gt;
&lt;p&gt;Basically this is what the site will be about. Surveying decisions that you and your friends have to make on a daily basis. What movie should we go to? Where should we eat? What types of food should we bring to a get-together?&lt;/p&gt;</description><link>http://programmedundertheinfluence.com/post/159229375</link><guid>http://programmedundertheinfluence.com/post/159229375</guid><pubDate>Sun, 09 Aug 2009 10:31:00 -0700</pubDate><category>survey</category><category>vote</category><category>web</category><category>page</category><category>php</category><category>jquery</category><category>question</category><category>poll</category></item><item><title>Commenting… you’re doing it right :D
These are two...</title><description>&lt;img src="http://27.media.tumblr.com/NzFjB4XIAqwm1ueqDNz6BpFmo1_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;img src="http://24.media.tumblr.com/NzFjB4XIAqwm1ueqDNz6BpFmo2_500.png"/&gt;&lt;br/&gt; &lt;br/&gt;&lt;p&gt;Commenting… you’re doing it right :D&lt;/p&gt;
&lt;p&gt;These are two examples of my new commenting system:
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;What!? No Way! (in alpha)&lt;/li&gt;&lt;li&gt;Pollacio.us (coming shortly)&lt;/li&gt;&lt;/ul&gt;</description><link>http://programmedundertheinfluence.com/post/158835263</link><guid>http://programmedundertheinfluence.com/post/158835263</guid><pubDate>Sat, 08 Aug 2009 17:58:00 -0700</pubDate><category>comment</category><category>commenting</category><category>form</category><category>post</category><category>reply</category><category>picture</category><category>jquery</category><category>php</category><category>html</category></item><item><title>Posting checkbox values with PHP and jQuery</title><description>&lt;p&gt;For some time I had trouble figuring out how to post checkbox results using jQuery’s $.post function after submitting a form. I searched many different sites finding pieces of the a solution that would fit my needs.&lt;br/&gt;Anyway here’s what I got:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1) Let’s create a simple form.&lt;/strong&gt;&lt;br/&gt;&lt;/p&gt;&lt;pre style="font-size: 10px;"&gt;
    &lt;form id="my_form" onsubmit="return processForm()"&gt;
        1) &lt;input type="checkbox" class="option" name="options[]" value="1" /&gt;&lt;br /&gt;
        2) &lt;input type="checkbox" class="option" name="options[]" value="2" /&gt;&lt;br /&gt;
        3) &lt;input type="checkbox" class="option" name="options[]" value="3" /&gt;&lt;br /&gt;
        &lt;input type="submit" value="Submit" /&gt;
    &lt;/form&gt;
&lt;/pre&gt;

&lt;br/&gt;&lt;p&gt;&lt;strong&gt;2) Create the javascript to handle the form submission.&lt;/strong&gt;&lt;br/&gt;&lt;/p&gt;&lt;pre&gt;
    function processForm() {
        var options = $('#my_form :input.option');
        var option_array = new Array();
        
        $.each(options, function(index, element) {
            if ($(element).is(':checked')) {
                option_array.push($(element).val());
            }
    
        // Post options to action file
        $.post('&lt;em&gt;/your/path/to/action/file.php&lt;/em&gt;', {'options[]': option_array});
        
        return false;
    }
&lt;/pre&gt;

&lt;br/&gt;&lt;p&gt;&lt;strong&gt;3) Handle the form submission using PHP.&lt;/strong&gt;&lt;br/&gt;&lt;/p&gt;&lt;pre&gt;
    &lt;?php
        foreach ($_POST['options'] as $option) {
            /* Do whatever you want with your options here. */
        }
        
        // Or you can just print the results to the screen for test purposes
        print_r($_POST);
        exit;
    ?&gt;
&lt;/pre&gt;</description><link>http://programmedundertheinfluence.com/post/158351280</link><guid>http://programmedundertheinfluence.com/post/158351280</guid><pubDate>Fri, 07 Aug 2009 21:09:00 -0700</pubDate><category>jquery</category><category>post</category><category>php</category><category>javascript</category><category>html</category><category>checkboxes</category><category>input</category><category>form</category></item><item><title>jQuery API</title><description>&lt;a href="http://remysharp.com/jquery-api/"&gt;jQuery API&lt;/a&gt;: &lt;p&gt;…never code without it.&lt;br/&gt;&lt;small&gt;&lt;em&gt;Courtesy of &lt;a href="http://remysharp.com/" target="_blank"&gt;Remy Sharp&lt;/a&gt;&lt;/em&gt;&lt;small&gt;&lt;/small&gt;&lt;/small&gt;&lt;/p&gt;</description><link>http://programmedundertheinfluence.com/post/157699150</link><guid>http://programmedundertheinfluence.com/post/157699150</guid><pubDate>Thu, 06 Aug 2009 22:29:00 -0700</pubDate></item><item><title>New site on the horizon...</title><description>&lt;p&gt;I am almost proud to present my latest site.&lt;br/&gt;
I am very close to wrapping it up, but I think it will be another week of perfecting it and making sure all the screws are tightened.&lt;/p&gt;

&lt;p&gt;Here are some screen captures for a teaser:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Login Form (Header)&lt;/strong&gt;&lt;br/&gt;&lt;img src="http://skrolikowski.com/images/sitepreviews/survey_login.png" alt="Login Form"/&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Register Form&lt;/strong&gt;&lt;br/&gt;&lt;img src="http://skrolikowski.com/images/sitepreviews/survey_register.png" alt="Register Form"/&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Survey Overview&lt;/strong&gt;&lt;br/&gt;&lt;img src="http://skrolikowski.com/images/sitepreviews/survey_view.png" alt="Survey Overview"/&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Voting Booth&lt;/strong&gt;&lt;br/&gt;&lt;img src="http://skrolikowski.com/images/sitepreviews/survey_vote.png" alt="Voting Booth"/&gt;&lt;/p&gt;</description><link>http://programmedundertheinfluence.com/post/157640753</link><guid>http://programmedundertheinfluence.com/post/157640753</guid><pubDate>Thu, 06 Aug 2009 20:52:00 -0700</pubDate><category>survey</category><category>site</category><category>login</category><category>register</category><category>form</category></item></channel></rss>

