<?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>media&#124;extranet &#187; Scripting</title>
	<atom:link href="http://www.mediaextra.net/category/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mediaextra.net</link>
	<description>campaign, connect and conquor</description>
	<lastBuildDate>Thu, 04 Mar 2010 05:23:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>JQuery, Prototype, Mootools?</title>
		<link>http://www.mediaextra.net/2010/workflow/jquery-prototype-mootools/</link>
		<comments>http://www.mediaextra.net/2010/workflow/jquery-prototype-mootools/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 05:14:19 +0000</pubDate>
		<dc:creator>Jack Keller</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://www.mediaextra.net/2010/workflow/jquery-prototype-mootools/</guid>
		<description><![CDATA[Okay, so there are a seemingly endless supply of javascript frameworks for you to develop with, so which one is right for you?
Maybe a better way to go about this subject is how I arrived at my chosen framework. I used to be all about Mootools by default, maybe it was the name, maybe the [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so there are a seemingly endless supply of javascript frameworks for you to develop with, so which one is right for you?</p>
<p>Maybe a better way to go about this subject is how I arrived at my chosen framework. I used to be all about Mootools by default, maybe it was the name, maybe the fact I like beef, maybe that I really dug their web site. I eventually (after sporadically testing different frameworks) arrived at JQuery as my default. So what made me choose JQuery over the countless others? Plain and simple it was the community support. Having a great framework or script is all well and good, but when you have a great user base out there that shares their innovations and discoveries then it makes it all the better. It probably didn’t hurt that in my employment we write in .NET technology and in that technology Microsoft decided that it would embrace JQuery as it’s default framework for Javascript going forward, so for me that’s a Win/Win. I program in .NET at work but do a lot of PHP stuff in my offtime, so a framework that appeals to both androgynously really perked up my senses.</p>
<p>So what is your preferred framework, and why?</p>

<div class="sociable">
<div class="sociable_tagline">
Share?
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.mediaextra.net%2F2010%2Fworkflow%2Fjquery-prototype-mootools%2F&amp;t=JQuery%2C%20Prototype%2C%20Mootools%3F" title="Facebook"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.designfloat.com/submit.php?url=http%3A%2F%2Fwww.mediaextra.net%2F2010%2Fworkflow%2Fjquery-prototype-mootools%2F&amp;title=JQuery%2C%20Prototype%2C%20Mootools%3F" title="Design Float"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/designfloat.png" title="Design Float" alt="Design Float" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.mediaextra.net%2F2010%2Fworkflow%2Fjquery-prototype-mootools%2F&amp;title=JQuery%2C%20Prototype%2C%20Mootools%3F&amp;notes=Okay%2C%20so%20there%20are%20a%20seemingly%20endless%20supply%20of%20javascript%20frameworks%20for%20you%20to%20develop%20with%2C%20so%20which%20one%20is%20right%20for%20you%3F%0D%0A%0D%0AMaybe%20a%20better%20way%20to%20go%20about%20this%20subject%20is%20how%20I%20arrived%20at%20my%20chosen%20framework.%20I%20used%20to%20be%20all%20about%20Mootools%20by%20" title="del.icio.us"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mediaextra.net%2F2010%2Fworkflow%2Fjquery-prototype-mootools%2F&amp;title=JQuery%2C%20Prototype%2C%20Mootools%3F" title="StumbleUpon"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.mediaextra.net%2F2010%2Fworkflow%2Fjquery-prototype-mootools%2F" title="Technorati"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.mediaextra.net%2F2010%2Fworkflow%2Fjquery-prototype-mootools%2F&amp;title=JQuery%2C%20Prototype%2C%20Mootools%3F&amp;bodytext=Okay%2C%20so%20there%20are%20a%20seemingly%20endless%20supply%20of%20javascript%20frameworks%20for%20you%20to%20develop%20with%2C%20so%20which%20one%20is%20right%20for%20you%3F%0D%0A%0D%0AMaybe%20a%20better%20way%20to%20go%20about%20this%20subject%20is%20how%20I%20arrived%20at%20my%20chosen%20framework.%20I%20used%20to%20be%20all%20about%20Mootools%20by%20" title="Digg"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mediaextra.net/2010/workflow/jquery-prototype-mootools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips on Local Development</title>
		<link>http://www.mediaextra.net/2010/workflow/tips-on-local-development/</link>
		<comments>http://www.mediaextra.net/2010/workflow/tips-on-local-development/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 05:53:36 +0000</pubDate>
		<dc:creator>Jack Keller</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://www.mediaextra.net/?p=57</guid>
		<description><![CDATA[Okay, so I've posted before about MAMP, XAMPP and the alternatives but now I'm going to dig a bit deeper into tricks and tips. Bear in mind that I'm writing this on how I do my development and your software choices and the like may be somewhat different than mine.
Localhost: 	XAMPP
Language:		PHP
Database:		Sequel Pro
Editor:		Coda
OS:			Snow Leopard
I usually set [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so I've posted before about MAMP, XAMPP and the alternatives but now I'm going to dig a bit deeper into tricks and tips. Bear in mind that I'm writing this on how I do my development and your software choices and the like may be somewhat different than mine.</p>
<p>Localhost: 	<a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a><br />
Language:		<a href="http://www.php.net/">PHP</a><br />
Database:		<a href="http://www.sequelpro.com/">Sequel Pro</a><br />
Editor:		<a href="http://panic.com/coda/">Coda</a><br />
OS:			<a href="http://www.apple.com/macosx/">Snow Leopard</a></p>
<p>I usually set up my sites in the Default <strong>~/Sites</strong> folder on my Mac, just to keep things in one area mainly and for this demo we'll be using stardup.com (a domain I own and have never really done anything with due to time restraints).</p>
<p>I found this tutorial online a while back by <a href="http://www.acwolf.com/2009/02/24/xampp-virtual-hosts-on-a-mac/">Arron Wolf</a> and it was a really good way to keep my logical file structure instead of duping directories back and forth from XAMPP's native htdocs folder. This is not super intense a process even though some people may shy away from Command Line. Follow along with the instructions on that site if you want to get it set up for your latest project. Go ahead, I'll wait…</p>
<p>…Okay great, you're back! Now let's begin with one really dead easy trick to keep your configuration files working on both sides, without having to change them every time you commit many site changes.</p>
<div class="igBar"><span id="lphp-3"><a href="#" onclick="javascript:showPlainTxt('php-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-3">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">(</span><span style="color:#0000FF;">$_SERVER</span><span style="color:#006600; font-weight:bold;">[</span><span style="color:#FF0000;">"REMOTE_ADDR"</span><span style="color:#006600; font-weight:bold;">]</span> == <span style="color:#FF0000;">"127.0.0.1"</span><span style="color:#006600; font-weight:bold;">)</span> <span style="color:#006600; font-weight:bold;">{</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color:#0000FF;">$l</span> = <a href="http://www.php.net/mysql_connect"><span style="color:#000066;">mysql_connect</span></a> <span style="color:#006600; font-weight:bold;">(</span> <span style="color:#FF0000;">"localhost"</span> , <span style="color:#FF0000;">"root"</span> , <span style="color:#FF0000;">""</span> <span style="color:#006600; font-weight:bold;">)</span> or <a href="http://www.php.net/die"><span style="color:#000066;">die</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#FF0000;">"Error connecting: &lt;br /&gt;&lt;br /&gt;"</span>.<a href="http://www.php.net/mysql_error"><span style="color:#000066;">mysql_error</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#006600; font-weight:bold;">)</span><span style="color:#006600; font-weight:bold;">)</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <a href="http://www.php.net/mysql_select_db"><span style="color:#000066;">mysql_select_db</span></a><span style="color:#006600; font-weight:bold;">(</span> <span style="color:#FF0000;">"stardup"</span> <span style="color:#006600; font-weight:bold;">)</span> or <a href="http://www.php.net/die"><span style="color:#000066;">die</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#FF0000;">"Error getting db: &lt;br /&gt;&lt;br /&gt;"</span>.<a href="http://www.php.net/mysql_error"><span style="color:#000066;">mysql_error</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#006600; font-weight:bold;">)</span><span style="color:#006600; font-weight:bold;">)</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    </div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color:#0000FF;">$siteurl</span> = <span style="color:#FF0000;">"http://stardup.dev/"</span>; <span style="color:#FF9933; font-style:italic;">// WITH TRAILING SLASH!</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">}</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">{</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color:#0000FF;">$l</span> = <a href="http://www.php.net/mysql_connect"><span style="color:#000066;">mysql_connect</span></a> <span style="color:#006600; font-weight:bold;">(</span> <span style="color:#FF0000;">"localhost"</span> , <span style="color:#FF0000;">"stardup_user"</span> , <span style="color:#FF0000;">"**********"</span> <span style="color:#006600; font-weight:bold;">)</span> or <a href="http://www.php.net/die"><span style="color:#000066;">die</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#FF0000;">"Error connecting: &lt;br /&gt;&lt;br /&gt;"</span>.<a href="http://www.php.net/mysql_error"><span style="color:#000066;">mysql_error</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#006600; font-weight:bold;">)</span><span style="color:#006600; font-weight:bold;">)</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <a href="http://www.php.net/mysql_select_db"><span style="color:#000066;">mysql_select_db</span></a><span style="color:#006600; font-weight:bold;">(</span> <span style="color:#FF0000;">"stardup"</span> <span style="color:#006600; font-weight:bold;">)</span> or <a href="http://www.php.net/die"><span style="color:#000066;">die</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#FF0000;">"Error getting db: &lt;br /&gt;&lt;br /&gt;"</span>.<a href="http://www.php.net/mysql_error"><span style="color:#000066;">mysql_error</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#006600; font-weight:bold;">)</span><span style="color:#006600; font-weight:bold;">)</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color:#0000FF;">$siteurl</span> = <span style="color:#FF0000;">"http://stardup.com/"</span>; <span style="color:#FF9933; font-style:italic;">// WITH TRAILING SLASH!</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">}</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This can be done in any other programming language, however the if/else syntax changes a bit. I've also begun taking this a little further, including other bits in my code like $header and $footer stuff that will help me visually determine which one I may be looking at (as I'm often too lazy to look at the address bar).</p>
<p>So my next tip is related to running a lightweight version of XAMPP (because you really don't need all of the features for local development). I write a very simple Applescript that launches XAMPP with options, and then placed it in my System Preferences &gt; Accounts &gt; My Account &gt; Login Items</p>
<div class="igBar"><span id="lcode-4"><a href="#" onclick="javascript:showPlainTxt('code-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-4">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">do shell script <span style="color:#CC0000;">"/Applications/XAMPP/xamppfiles/xampp startapache"</span> user name <span style="color:#CC0000;">"yourname"</span> password <span style="color:#CC0000;">"yourpassword"</span> with administrator privileges</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">do shell script <span style="color:#CC0000;">"/Applications/XAMPP/xamppfiles/xampp startmysql"</span> user name <span style="color:#CC0000;">"yourname"</span> password <span style="color:#CC0000;">"yourpassword"</span> with administrator privileges </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now I know a lot of the more hardcore programmers are probably wondering why I have to do the username/pass with administrator privileges twice, the answer is because I know only as much Applescript as I need to, and nothing more.</p>

<div class="sociable">
<div class="sociable_tagline">
Share?
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.mediaextra.net%2F2010%2Fworkflow%2Ftips-on-local-development%2F&amp;t=Tips%20on%20Local%20Development" title="Facebook"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.designfloat.com/submit.php?url=http%3A%2F%2Fwww.mediaextra.net%2F2010%2Fworkflow%2Ftips-on-local-development%2F&amp;title=Tips%20on%20Local%20Development" title="Design Float"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/designfloat.png" title="Design Float" alt="Design Float" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.mediaextra.net%2F2010%2Fworkflow%2Ftips-on-local-development%2F&amp;title=Tips%20on%20Local%20Development&amp;notes=Okay%2C%20so%20I%27ve%20posted%20before%20about%20MAMP%2C%20XAMPP%20and%20the%20alternatives%20but%20now%20I%27m%20going%20to%20dig%20a%20bit%20deeper%20into%20tricks%20and%20tips.%20Bear%20in%20mind%20that%20I%27m%20writing%20this%20on%20how%20I%20do%20my%20development%20and%20your%20software%20choices%20and%20the%20like%20may%20be%20somewhat%20differ" title="del.icio.us"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mediaextra.net%2F2010%2Fworkflow%2Ftips-on-local-development%2F&amp;title=Tips%20on%20Local%20Development" title="StumbleUpon"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.mediaextra.net%2F2010%2Fworkflow%2Ftips-on-local-development%2F" title="Technorati"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.mediaextra.net%2F2010%2Fworkflow%2Ftips-on-local-development%2F&amp;title=Tips%20on%20Local%20Development&amp;bodytext=Okay%2C%20so%20I%27ve%20posted%20before%20about%20MAMP%2C%20XAMPP%20and%20the%20alternatives%20but%20now%20I%27m%20going%20to%20dig%20a%20bit%20deeper%20into%20tricks%20and%20tips.%20Bear%20in%20mind%20that%20I%27m%20writing%20this%20on%20how%20I%20do%20my%20development%20and%20your%20software%20choices%20and%20the%20like%20may%20be%20somewhat%20differ" title="Digg"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mediaextra.net/2010/workflow/tips-on-local-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Local Development using MAMP</title>
		<link>http://www.mediaextra.net/2009/workflow/local-dev-using-mamp/</link>
		<comments>http://www.mediaextra.net/2009/workflow/local-dev-using-mamp/#comments</comments>
		<pubDate>Sun, 03 May 2009 06:17:36 +0000</pubDate>
		<dc:creator>Jack Keller</dc:creator>
				<category><![CDATA[Mac Software]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://www.mediaextra.net/?p=44</guid>
		<description><![CDATA[When I'm developing a Web site sometimes I will take my initial development local and run a local server. Obviously for projects already online or projects that do not require full database integration I do not need to run one all of the time. This is where MAMP comes into play, or if you run [...]]]></description>
			<content:encoded><![CDATA[<p>When I'm developing a Web site sometimes I will take my initial development local and run a local server. Obviously for projects already online or projects that do not require full database integration I do not need to run one all of the time. This is where <a href="http://www.mamp.info/">MAMP</a> comes into play, or if you run Windows <a href="http://www.wampserver.com/en/">WAMP</a>* would be your flavor.</p>
<p>What exactly do these terms mean? The <strong>M</strong> and <strong>W</strong> stand for your working platform by way of Macintosh or Windows and the <acronym title="Apache, MySQL and PHP">AMP</acronym> stands for Apache, MySQL and PHP. These simple apps can start and stop the full suite of hosting tools at a moments notice without you having to muck around in your system and install all sorts of tools that require more in depth configuration. I've found that overall this can speed up programming and testing because you will not need to constantly upload files to an FTP server and check them that way, instead you would just save and refresh your browser.</p>
<p>And it would be sort of open-source blasphemy if I didn't mention XAMPP mainly used for Linux, but also containing flavors of Mac OS X, Windows and even Solaris.</p>
<p>All of these software packages are free, or have a free (lite) version available for you to use in your programming endeavors so have at it!</p>
<p><em style="font-size:10px;">*Windows &amp; WAMP makes the assumption that you are developing a PHP/MySQL Web site and not a .NET Solution</em></p>
<p><strong>Update:</strong> I have moved from MAMP to XAMPP for local development, it's a little more flexible for my usage.</p>

<div class="sociable">
<div class="sociable_tagline">
Share?
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.mediaextra.net%2F2009%2Fworkflow%2Flocal-dev-using-mamp%2F&amp;t=Local%20Development%20using%20MAMP" title="Facebook"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.designfloat.com/submit.php?url=http%3A%2F%2Fwww.mediaextra.net%2F2009%2Fworkflow%2Flocal-dev-using-mamp%2F&amp;title=Local%20Development%20using%20MAMP" title="Design Float"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/designfloat.png" title="Design Float" alt="Design Float" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.mediaextra.net%2F2009%2Fworkflow%2Flocal-dev-using-mamp%2F&amp;title=Local%20Development%20using%20MAMP&amp;notes=When%20I%27m%20developing%20a%20Web%20site%20sometimes%20I%20will%20take%20my%20initial%20development%20local%20and%20run%20a%20local%20server.%20Obviously%20for%20projects%20already%20online%20or%20projects%20that%20do%20not%20require%20full%20database%20integration%20I%20do%20not%20need%20to%20run%20one%20all%20of%20the%20time.%20This%20i" title="del.icio.us"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mediaextra.net%2F2009%2Fworkflow%2Flocal-dev-using-mamp%2F&amp;title=Local%20Development%20using%20MAMP" title="StumbleUpon"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.mediaextra.net%2F2009%2Fworkflow%2Flocal-dev-using-mamp%2F" title="Technorati"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.mediaextra.net%2F2009%2Fworkflow%2Flocal-dev-using-mamp%2F&amp;title=Local%20Development%20using%20MAMP&amp;bodytext=When%20I%27m%20developing%20a%20Web%20site%20sometimes%20I%20will%20take%20my%20initial%20development%20local%20and%20run%20a%20local%20server.%20Obviously%20for%20projects%20already%20online%20or%20projects%20that%20do%20not%20require%20full%20database%20integration%20I%20do%20not%20need%20to%20run%20one%20all%20of%20the%20time.%20This%20i" title="Digg"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mediaextra.net/2009/workflow/local-dev-using-mamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy PHP contact form, with gotcha!</title>
		<link>http://www.mediaextra.net/2008/scripting/php/easy-php-contact-form-gotcha/</link>
		<comments>http://www.mediaextra.net/2008/scripting/php/easy-php-contact-form-gotcha/#comments</comments>
		<pubDate>Mon, 19 May 2008 22:19:42 +0000</pubDate>
		<dc:creator>Jack Keller</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[$_POST]]></category>
		<category><![CDATA[contact form]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[isset]]></category>
		<category><![CDATA[spam prevention]]></category>

		<guid isPermaLink="false">http://www.mediaextra.net/?p=19</guid>
		<description><![CDATA[Yes that's right, I called it Gotcha. So why Gotcha? Simple really, it's not as involved as a Captcha (also not as secure but will fend off most spambots). Below I have written a very simple Contact form in PHP, I will explain the goods right after the form.
Okay, let's take a step through this [...]]]></description>
			<content:encoded><![CDATA[<p>Yes that's right, I called it Gotcha. So why Gotcha? Simple really, it's not as involved as a Captcha (also not as secure but will fend off most spambots). Below I have written a very simple Contact form in PHP, I will explain the goods right after the form.<span id="more-19"></span></p>
<p>Okay, let's take a step through this method. First off is the <strong>if(isset($_POST['submit']))</strong>, all that really does it tell the page to run the mail and spam checking functions if the user submitted the form. Then it gets the POST methods from the submission and we set the variables.</p>
<div class="igBar"><span id="lphp-9"><a href="#" onclick="javascript:showPlainTxt('php-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-9">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">(</span><a href="http://www.php.net/isset"><span style="color:#000066;">isset</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">[</span><span style="color:#FF0000;">'submit'</span><span style="color:#006600; font-weight:bold;">]</span><span style="color:#006600; font-weight:bold;">)</span><span style="color:#006600; font-weight:bold;">)</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">{</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$name</span> = <span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">[</span><span style="color:#FF0000;">'name'</span><span style="color:#006600; font-weight:bold;">]</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$email</span> = <span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">[</span><span style="color:#FF0000;">'email'</span><span style="color:#006600; font-weight:bold;">]</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$stuff</span> = <span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">[</span><span style="color:#FF0000;">'stuff'</span><span style="color:#006600; font-weight:bold;">]</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$human</span> = <span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">[</span><span style="color:#FF0000;">'human'</span><span style="color:#006600; font-weight:bold;">]</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The <strong>if ($human != "123") {</strong> business checks that the user is not a spambot.</p>
<p>In this case <strong>ABC is easy as 123</strong>, so if the user doesn't type in 123 it will alert them and send them back to the previous page (I hate to click a back button, so I took that step out). If they do answer <strong>123</strong> the script will hit the next block, which is a basic PHP mail function. If they did not it alerts them and sends a history.back(1) script so they can take another whack at it.</p>
<div class="igBar"><span id="lphp-10"><a href="#" onclick="javascript:showPlainTxt('php-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-10">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">(</span><span style="color:#0000FF;">$human</span> != <span style="color:#FF0000;">"123"</span><span style="color:#006600; font-weight:bold;">)</span> <span style="color:#006600; font-weight:bold;">{</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;script&gt;alert('Whoa $name you either answered the last question wrong, or forgot to answer at all!');"</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;/script&gt;&lt;script&gt;history.back(1)&lt;/script&gt;'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <a href="http://www.php.net/exit"><span style="color:#000066;">exit</span></a>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">}</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>If the user did answer the secret question correctly, the script can move onto the next step. In this step the users comments will be sent to you. So I set a variable for your email (in this example you@yourdomain.com, pretty basic I know). Then the subject and message body. Tip, you can inject the variables from the first step into your subject and message, in fact you need to somewhere or you won't get any info. You do this by using the $name, $email, etc.</p>
<div class="igBar"><span id="lphp-11"><a href="#" onclick="javascript:showPlainTxt('php-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-11">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$to_email</span> = <span style="color:#FF0000;">"you@yourdomain.com"</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$subject</span> = <span style="color:#FF0000;">"$name wanted to tell you something"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$msg</span> = <span style="color:#FF0000;">"$name wanted to let you know $stuff&lt;br /&gt;Email them at &lt;a href='mailto:$email'&gt;$email&lt;/a&gt; to answer!"</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mailheaders</span> = <span style="color:#FF0000;">"From:  $email<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mailheaders</span> .= <span style="color:#FF0000;">"Reply-To:  $email<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mailheaders</span> .= <span style="color:#FF0000;">"Return-Path: $email<span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mailheaders</span> .= <span style="color:#FF0000;">"Content-type: text/html<span style="color:#000099; font-weight:bold;">\n</span><span style="color:#000099; font-weight:bold;">\n</span>"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/mail"><span style="color:#000066;">mail</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#0000FF;">$to_email</span>, <span style="color:#0000FF;">$subject</span>, <span style="color:#0000FF;">$msg</span>, <span style="color:#0000FF;">$mailheaders</span><span style="color:#006600; font-weight:bold;">)</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"&lt;script&gt;alert('Thanks for taking the time to contact me, $name I will get back to you as soon as possible!');&lt;/script&gt;"</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;script&gt;location.replace("/")&lt;/script&gt;'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <a href="http://www.php.net/exit"><span style="color:#000066;">exit</span></a>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">}</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">{</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Cool, the form was sent and the user was informed of their success, and then sent to the site root. The <strong>} else {</strong> is fairly important, without this nothing will show up for the user to fill out.</p>
<div class="igBar"><span id="lphp-12"><a href="#" onclick="javascript:showPlainTxt('php-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-12">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$form</span> = <span style="color:#FF0000;">'&lt;form action="'</span>.<span style="color:#0000FF;">$_SERVER</span><span style="color:#006600; font-weight:bold;">[</span><span style="color:#FF0000;">'PHP_SELF'</span><span style="color:#006600; font-weight:bold;">]</span>.<span style="color:#FF0000;">'" method="post"&gt;'</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$form</span> .= <span style="color:#FF0000;">'And you are?&lt;br /&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">    &lt;input type="text" name="name" id="name" /&gt;&lt;br /&gt; </span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">    I can email you where?&lt;br /&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">    &lt;input type="text" name="email" id="email" /&gt;&lt;br /&gt;</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">    You<span style="color:#000099; font-weight:bold;">\'</span>d like to tell me?&lt;br /&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">    &lt;textarea name="stuff" id="stuff"&gt;&lt;/textarea&gt;&lt;br /&gt;</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">    ABC is easy as &lt;input type="text" name="human" id="human" size="3" /&gt; (&lt;em&gt;According to the Jackson 5&lt;/em&gt;)&lt;br /&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">    &lt;input name="submit" type="submit" value="Tell Me Something Good!" /&gt;</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">&lt;/form&gt;'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$form</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">}</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Lastly, do not forget to put your <strong>}</strong> before the end of the script, I say that because I sometimes forget that.</p>
<p>So that's it, if you want to download this script for reference <a href="http://stardup.com/urls/gotcha_php/">click here</a> If you just copy and paste the highlighted code you'll have to replace all ' with the proper single ticks.</p>

<div class="sociable">
<div class="sociable_tagline">
Share?
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Feasy-php-contact-form-gotcha%2F&amp;t=Easy%20PHP%20contact%20form%2C%20with%20gotcha%21" title="Facebook"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.designfloat.com/submit.php?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Feasy-php-contact-form-gotcha%2F&amp;title=Easy%20PHP%20contact%20form%2C%20with%20gotcha%21" title="Design Float"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/designfloat.png" title="Design Float" alt="Design Float" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Feasy-php-contact-form-gotcha%2F&amp;title=Easy%20PHP%20contact%20form%2C%20with%20gotcha%21&amp;notes=Yes%20that%27s%20right%2C%20I%20called%20it%20Gotcha.%20So%20why%20Gotcha%3F%20Simple%20really%2C%20it%27s%20not%20as%20involved%20as%20a%20Captcha%20%28also%20not%20as%20secure%20but%20will%20fend%20off%20most%20spambots%29.%20Below%20I%20have%20written%20a%20very%20simple%20Contact%20form%20in%20PHP%2C%20I%20will%20explain%20the%20goods%20right%20after%20t" title="del.icio.us"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Feasy-php-contact-form-gotcha%2F&amp;title=Easy%20PHP%20contact%20form%2C%20with%20gotcha%21" title="StumbleUpon"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Feasy-php-contact-form-gotcha%2F" title="Technorati"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Feasy-php-contact-form-gotcha%2F&amp;title=Easy%20PHP%20contact%20form%2C%20with%20gotcha%21&amp;bodytext=Yes%20that%27s%20right%2C%20I%20called%20it%20Gotcha.%20So%20why%20Gotcha%3F%20Simple%20really%2C%20it%27s%20not%20as%20involved%20as%20a%20Captcha%20%28also%20not%20as%20secure%20but%20will%20fend%20off%20most%20spambots%29.%20Below%20I%20have%20written%20a%20very%20simple%20Contact%20form%20in%20PHP%2C%20I%20will%20explain%20the%20goods%20right%20after%20t" title="Digg"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mediaextra.net/2008/scripting/php/easy-php-contact-form-gotcha/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Guide to a Print Friendly Website</title>
		<link>http://www.mediaextra.net/2008/scripting/css-scripting/guide-print-friendly-website/</link>
		<comments>http://www.mediaextra.net/2008/scripting/css-scripting/guide-print-friendly-website/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 04:21:25 +0000</pubDate>
		<dc:creator>Jack Keller</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[print media]]></category>

		<guid isPermaLink="false">http://www.mediaextra.net/2008/scripting/css-scripting/guide-print-friendly-website/</guid>
		<description><![CDATA[
Ever run across a good article on a website, but you were about to punch the timecard, or head away from the computer? What do you usually do, you can drag it to your overlowing bookmark bar where you will undoubtably forget about it for a few weeks. Maybe you post it to your del.icio.us [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.mediaextra.net/wp-content/uploads/2008/03/print-friendly-trans.png' alt='print friendly stylesheet' align='right' />
<p>Ever run across a good article on a website, but you were about to punch the timecard, or head away from the computer? What do you usually do, you can drag it to your overlowing bookmark bar where you will undoubtably forget about it for a few weeks. Maybe you post it to your del.icio.us account instead, or some other bookmarking site, where again you usually forget about it. I find it's helpful to just hit command+p (ctrl+p for the PC user) and normally get just an awfully layed out print of the page, and normally it has some content cut off, well that was useless and not very green to waste the paper and ink right?</p>
<p>After a week of finding articles and not being able to get a decent print I aimed to fix it for our site, and then write about how others could do the same. If your a designer and your getting a lot of traffic it stands to reason that someone may at some point print out your article for later reading.</p>
<p><span id="more-13"></span>
<p><strong>Step one:</strong> You can do this a few ways, the simplest may be making a copy of your style.css (in some cases the name may differ of course) and name that file print.css. Then fire up your favorite text or CSS editor and get to work on hiding your elements that have no need to print. (navigation, headers, backgrounds, etc. can usually get tossed out for this stylesheet) using a simple <strong>display: none;</strong> is normally quite effective.</p>
<p><strong>Step two:</strong> Start to choose the selectors you want to hide for the print view, normally I set up, jot them down or directly edit the file. You'll end up cutting out the dead weight before you finish your edits. A very simple demo below is an example of how to hide everything but the article for this site. </p>
<div class="igBar"><span id="lcss-15"><a href="#" onclick="javascript:showPlainTxt('css-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-15">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">* <span style="color: #66cc66;">{</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #000000; font-weight: bold;">margin</span>: <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #000000; font-weight: bold;">padding</span>: <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #000000; font-weight: bold;">font-family</span>: <span style="color: #ff0000;">"Times New Roman"</span>, Times, <span style="color: #993333;">serif</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">}</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.<span style="color: #000000; font-weight: bold;">right</span>, .navigation, .searchheader, .<span style="color: #000000; font-weight: bold;">bottom</span>, #comment-form, #respond, #comments, ol.commentlist, <span style="color: #6666ff;">.sociable </span><span style="color: #66cc66;">{</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #000000; font-weight: bold;">display</span>: <span style="color: #993333;">none</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">}</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #6666ff;">.wrapper </span><span style="color: #66cc66;">{</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #000000; font-weight: bold;">width</span>: <span style="color: #cc66cc;color:#800000;">8</span>.5in;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #000000; font-weight: bold;">padding-right</span>: .75in;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #000000; font-weight: bold;">padding-left</span>: .75in;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">}</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ol, ul <span style="color: #66cc66;">{</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #000000; font-weight: bold;">margin-left</span>: 40px;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #000000; font-weight: bold;">margin-right</span>: 40px;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">}</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #6666ff;">.descr </span><span style="color: #66cc66;">{</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #000000; font-weight: bold;">margin-bottom</span>: 20px;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">}</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #6666ff;">.entry </span><span style="color: #66cc66;">{</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #000000; font-weight: bold;">visibility</span>: <span style="color: #993333;">visible</span>!important;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">}</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.footer, <span style="color: #6666ff;">.info </span><span style="color: #66cc66;">{</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #000000; font-weight: bold;">margin-top</span>: 20px;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">}</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">a <span style="color: #66cc66;">{</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #000000; font-weight: bold;">color</span>: <span style="color: #000000; font-weight: bold;">black</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #000000; font-weight: bold;">text-decoration</span>: <span style="color: #993333;">none</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">}</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Put this line into your page head so that the browser will know to grab this stylesheet for printing. The main difference between this and main stylesheet is the <strong>media</strong> portion.</p>
<div class="igBar"><span id="lhtml-16"><a href="#" onclick="javascript:showPlainTxt('html-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-16">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/link.html"><span style="color: #000000; font-weight: bold;">&lt;link</span></a> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">"http://www.yoursite.com/print.css"</span> <span style="color: #000066;">media</span>=<span style="color: #ff0000;">"print"</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/css"</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">"stylesheet"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p> </p>

<div class="sociable">
<div class="sociable_tagline">
Share?
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fcss-scripting%2Fguide-print-friendly-website%2F&amp;t=Guide%20to%20a%20Print%20Friendly%20Website" title="Facebook"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.designfloat.com/submit.php?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fcss-scripting%2Fguide-print-friendly-website%2F&amp;title=Guide%20to%20a%20Print%20Friendly%20Website" title="Design Float"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/designfloat.png" title="Design Float" alt="Design Float" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fcss-scripting%2Fguide-print-friendly-website%2F&amp;title=Guide%20to%20a%20Print%20Friendly%20Website&amp;notes=Ever%20run%20across%20a%20good%20article%20on%20a%20website%2C%20but%20you%20were%20about%20to%20punch%20the%20timecard%2C%20or%20head%20away%20from%20the%20computer%3F%20What%20do%20you%20usually%20do%2C%20you%20can%20drag%20it%20to%20your%20overlowing%20bookmark%20bar%20where%20you%20will%20undoubtably%20forget%20about%20it%20for%20a%20few%20weeks." title="del.icio.us"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fcss-scripting%2Fguide-print-friendly-website%2F&amp;title=Guide%20to%20a%20Print%20Friendly%20Website" title="StumbleUpon"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fcss-scripting%2Fguide-print-friendly-website%2F" title="Technorati"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fcss-scripting%2Fguide-print-friendly-website%2F&amp;title=Guide%20to%20a%20Print%20Friendly%20Website&amp;bodytext=Ever%20run%20across%20a%20good%20article%20on%20a%20website%2C%20but%20you%20were%20about%20to%20punch%20the%20timecard%2C%20or%20head%20away%20from%20the%20computer%3F%20What%20do%20you%20usually%20do%2C%20you%20can%20drag%20it%20to%20your%20overlowing%20bookmark%20bar%20where%20you%20will%20undoubtably%20forget%20about%20it%20for%20a%20few%20weeks." title="Digg"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mediaextra.net/2008/scripting/css-scripting/guide-print-friendly-website/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Design Time: CSS Timeline Part 1</title>
		<link>http://www.mediaextra.net/2008/design/css-timeline-pt-1/</link>
		<comments>http://www.mediaextra.net/2008/design/css-timeline-pt-1/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 03:43:49 +0000</pubDate>
		<dc:creator>Jack Keller</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[cascading style sheet]]></category>
		<category><![CDATA[client work]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[reset]]></category>

		<guid isPermaLink="false">http://www.mediaextra.net/2008/design/css-timeline-pt-1/</guid>
		<description><![CDATA[You have a client, they have money, a goal begins to emerge. Before long you are headlong into a design project. What are the steps to take, how do you get from point "Okay, we have a deal" to point "Here's the finalized results now pay up"?
A project can start on a few different levels, [...]]]></description>
			<content:encoded><![CDATA[<p>You have a client, they have money, a goal begins to emerge. Before long you are headlong into a design project. What are the steps to take, how do you get from point "Okay, we have a deal" to point "Here's the finalized results now pay up"?</p>
<p>A project can start on a few different levels, either taking an existing design and creating a reality, or creating the concept from scratch, and then taking the concept into a reality. This here will only deal wiht the former as it's all about how to get the look from Photoshop* and putting it successfully to Firefox, IE, Safari, etc.</p>
<p><span id="more-11"></span>As most designers know it is easy to slice as design and prep it for the fun part, which is laying it out. I say fun because every design seems to teach me something new about cross-platform/cross-browser success. Most people who have done this a few times will start out with a good building block, I recommend <a href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/" title="CSS Reset Reloaded">Eric Meyers' CSS Reset</a> as a starting point. This technique tends to cut down the time it takes to tweak issues you will more than likely run into with standards development (Thank you Eric!).</p>
<p>So with that out of the way, what's the best way to start? I tend to reach for a trusty pad and pencil to sketch the page out and begin to label my base layout elements.</p>
<p>I usually begin with building blocks like:</p>
<ul>
<li>wrapper</li>
<li>container</li>
<li>masthead</li>
<li>content</li>
<li>navigation</li>
<li>footer</li>
</ul>
<p>But of course you will have to elaborate on those most times dependent on the design. But a good block like this works normally for my design needs. Next segment will actually entail code that I use for a basic building block!</p>
<p>Check back soon  as I will post some sample files in the next segment!</p>

<div class="sociable">
<div class="sociable_tagline">
Share?
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fdesign%2Fcss-timeline-pt-1%2F&amp;t=Design%20Time%3A%20CSS%20Timeline%20Part%201" title="Facebook"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.designfloat.com/submit.php?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fdesign%2Fcss-timeline-pt-1%2F&amp;title=Design%20Time%3A%20CSS%20Timeline%20Part%201" title="Design Float"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/designfloat.png" title="Design Float" alt="Design Float" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fdesign%2Fcss-timeline-pt-1%2F&amp;title=Design%20Time%3A%20CSS%20Timeline%20Part%201&amp;notes=You%20have%20a%20client%2C%20they%20have%20money%2C%20a%20goal%20begins%20to%20emerge.%20Before%20long%20you%20are%20headlong%20into%20a%20design%20project.%20What%20are%20the%20steps%20to%20take%2C%20how%20do%20you%20get%20from%20point%20%22Okay%2C%20we%20have%20a%20deal%22%20to%20point%20%22Here%27s%20the%20finalized%20results%20now%20pay%20up%22%3F%0D%0A%0D%0AA%20pro" title="del.icio.us"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fdesign%2Fcss-timeline-pt-1%2F&amp;title=Design%20Time%3A%20CSS%20Timeline%20Part%201" title="StumbleUpon"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fdesign%2Fcss-timeline-pt-1%2F" title="Technorati"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fdesign%2Fcss-timeline-pt-1%2F&amp;title=Design%20Time%3A%20CSS%20Timeline%20Part%201&amp;bodytext=You%20have%20a%20client%2C%20they%20have%20money%2C%20a%20goal%20begins%20to%20emerge.%20Before%20long%20you%20are%20headlong%20into%20a%20design%20project.%20What%20are%20the%20steps%20to%20take%2C%20how%20do%20you%20get%20from%20point%20%22Okay%2C%20we%20have%20a%20deal%22%20to%20point%20%22Here%27s%20the%20finalized%20results%20now%20pay%20up%22%3F%0D%0A%0D%0AA%20pro" title="Digg"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mediaextra.net/2008/design/css-timeline-pt-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Dynamic Image Gallery using PHP</title>
		<link>http://www.mediaextra.net/2008/scripting/php/simple-dynamic-image-gallery-using-php/</link>
		<comments>http://www.mediaextra.net/2008/scripting/php/simple-dynamic-image-gallery-using-php/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 00:29:29 +0000</pubDate>
		<dc:creator>Jack Keller</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.mediaextra.net/2008/simple-dynamic-image-gallery-using-php/</guid>
		<description><![CDATA[So often you may want to show a little gallery of photos on your blog or website, you have a few choices out there. Choice one would be to just do a down and dirty bit of html, &#60;img src=" etc etc or you could go with a program that creates galleries. Those usually don't [...]]]></description>
			<content:encoded><![CDATA[<p>So often you may want to show a little gallery of photos on your blog or website, you have a few choices out there. Choice one would be to just do a down and dirty bit of html, &lt;img src=" etc etc or you could go with a program that creates galleries. Those usually don't integrate with a site too well, and often are overkill for showing the world your new car, puppy or dinner entrees.</p>
<p>Luckily if you have your FTP program and a few pics handy you can just traverse your directories and spit out the files in code. This can be handy for swapping the files around and even adding more down the road, it will dynamically expand the gallery.</p>
<div class="igBar"><span id="lphp-19"><a href="#" onclick="javascript:showPlainTxt('php-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-19">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$path</span> = <span style="color:#FF0000;">"/home/user/public/foldername/"</span>; <span style="color:#FF9933; font-style:italic;">//path from root</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color:#0000FF;">$dir_handle</span> = @<a href="http://www.php.net/opendir"><span style="color:#000066;">opendir</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#0000FF;">$path</span><span style="color:#006600; font-weight:bold;">)</span> or <a href="http://www.php.net/die"><span style="color:#000066;">die</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#FF0000;">"Unable to open $path"</span><span style="color:#006600; font-weight:bold;">)</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color:#616100;">while</span> <span style="color:#006600; font-weight:bold;">(</span><span style="color:#0000FF;">$file</span> = <a href="http://www.php.net/readdir"><span style="color:#000066;">readdir</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#0000FF;">$dir_handle</span><span style="color:#006600; font-weight:bold;">)</span><span style="color:#006600; font-weight:bold;">)</span> <span style="color:#006600; font-weight:bold;">{</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">(</span><span style="color:#0000FF;">$file</span> == <span style="color:#FF0000;">"."</span> || <span style="color:#0000FF;">$file</span> == <span style="color:#FF0000;">".."</span> || <span style="color:#0000FF;">$file</span> == <span style="color:#FF0000;">"index.php"</span> <span style="color:#006600; font-weight:bold;">)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color:#616100;">continue</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;img src="$file" /&gt;&lt;br /&gt;'</span>; <span style="color:#FF9933; font-style:italic;">//formatting this is up to you</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">}</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/closedir"><span style="color:#000066;">closedir</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#0000FF;">$dir_handle</span><span style="color:#006600; font-weight:bold;">)</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>If you want to be slick, make thumbnails with the same name, but tag like tn_ before the image name and put them in another folder, this will allow you to call something like this:</p>
<div class="igBar"><span id="lphp-20"><a href="#" onclick="javascript:showPlainTxt('php-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-20">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'&lt;a href="$file"&gt;&lt;img src="otherfolder/tn_$file" /&gt;&lt;/a&gt;&lt;br /&gt;'</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Note:</strong> This will also work for files, you can add options to filter only images if you'd like.</p>

<div class="sociable">
<div class="sociable_tagline">
Share?
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Fsimple-dynamic-image-gallery-using-php%2F&amp;t=Simple%20Dynamic%20Image%20Gallery%20using%20PHP" title="Facebook"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.designfloat.com/submit.php?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Fsimple-dynamic-image-gallery-using-php%2F&amp;title=Simple%20Dynamic%20Image%20Gallery%20using%20PHP" title="Design Float"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/designfloat.png" title="Design Float" alt="Design Float" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Fsimple-dynamic-image-gallery-using-php%2F&amp;title=Simple%20Dynamic%20Image%20Gallery%20using%20PHP&amp;notes=So%20often%20you%20may%20want%20to%20show%20a%20little%20gallery%20of%20photos%20on%20your%20blog%20or%20website%2C%20you%20have%20a%20few%20choices%20out%20there.%20Choice%20one%20would%20be%20to%20just%20do%20a%20down%20and%20dirty%20bit%20of%20html%2C%20%26lt%3Bimg%20src%3D%22%20etc%20etc%20or%20you%20could%20go%20with%20a%20program%20that%20creates%20galleri" title="del.icio.us"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Fsimple-dynamic-image-gallery-using-php%2F&amp;title=Simple%20Dynamic%20Image%20Gallery%20using%20PHP" title="StumbleUpon"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Fsimple-dynamic-image-gallery-using-php%2F" title="Technorati"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Fsimple-dynamic-image-gallery-using-php%2F&amp;title=Simple%20Dynamic%20Image%20Gallery%20using%20PHP&amp;bodytext=So%20often%20you%20may%20want%20to%20show%20a%20little%20gallery%20of%20photos%20on%20your%20blog%20or%20website%2C%20you%20have%20a%20few%20choices%20out%20there.%20Choice%20one%20would%20be%20to%20just%20do%20a%20down%20and%20dirty%20bit%20of%20html%2C%20%26lt%3Bimg%20src%3D%22%20etc%20etc%20or%20you%20could%20go%20with%20a%20program%20that%20creates%20galleri" title="Digg"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mediaextra.net/2008/scripting/php/simple-dynamic-image-gallery-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Trick for Bloated OpenSource Software</title>
		<link>http://www.mediaextra.net/2008/scripting/php/php-trick-for-bloated-opensource/</link>
		<comments>http://www.mediaextra.net/2008/scripting/php/php-trick-for-bloated-opensource/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 05:52:52 +0000</pubDate>
		<dc:creator>Jack Keller</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://www.mediaextra.net/2008/php-trick-for-bloated-opensource/</guid>
		<description><![CDATA[If your anything like me nothing is great until you’ve hacked it apart. However with OpenSource software many times your hacks and mods will be overwritten every time you upgrade to the latest and greatest. So how can one combat this task with little to no hacks?
First off let me say that I’m not knocking [...]]]></description>
			<content:encoded><![CDATA[<p>If your anything like me nothing is great until you’ve hacked it apart. However with OpenSource software many times your hacks and mods will be overwritten every time you upgrade to the latest and greatest. So how can one combat this task with little to no hacks?</p>
<p>First off let me say that I’m not knocking any software here, I know that people pour hours and hours of their heart and soul into building something that can be used by nearly anybody. But as a seasoned designer I have to gripe about CSS bloat, it’s everywhere, tags nested ten to twenty levels deep sometimes.</p>
<p>So if you're using PHP, you can always do what I’ve done using the <strong>ob_start</strong> method (in fact it’s how I’m building the Acronyms for this site currently).</p>
<p>So if you want to change a few things around, this is a pretty good method to help you avoid hacking core files to an OpenSource application. The code below is what you want to place before your file starts, or your content area if you’re just looking to change some wording.</p>
<div class="igBar"><span id="lphp-23"><a href="#" onclick="javascript:showPlainTxt('php-23'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-23">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/ob_start"><span style="color:#000066;">ob_start</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#006600; font-weight:bold;">)</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<blockquote><p>This site was built using the Wordpress CMS and carefully loved with CSS for your viewing pleasure.</p></blockquote>
<div class="igBar"><span id="lphp-24"><a href="#" onclick="javascript:showPlainTxt('php-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-24">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// set up an array of words you want to find, then replace</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$mainnormal</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">(</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">’ CSS ‘,</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">’ CMS ‘,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">)</span>;</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$maincustom</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">(</span></div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">’ &lt;acronym title=<span style="color:#FF0000;">"Cascading Style Sheets"</span>&gt;CSS&lt;/acronym&gt; ‘,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">’ &lt;acronym title=<span style="color:#FF0000;">"Content Management System"</span>&gt;CMS&lt;/acronym&gt; ‘,</div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">)</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#444444;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> </div>
</li>
<li style="font-weight: bold;color:#D7D7D7;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <a href="http://www.php.net/str_replace"><span style="color:#000066;">str_replace</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#0000FF;">$mainnormal</span>,<span style="color:#0000FF;">$maincustom</span>,<a href="http://www.php.net/ob_get_clean"><span style="color:#000066;">ob_get_clean</span></a><span style="color:#006600; font-weight:bold;">(</span><span style="color:#006600; font-weight:bold;">)</span><span style="color:#006600; font-weight:bold;">)</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Simple array in place, if you were only going to replace one word on the site you could just surround it with quotes and put it into the echo str_replace function, I find this useful to help remove extra classes and ID’s unnecessary to a CMS, makes my job easier as a designer to keep the Stylesheet well formed.</p>

<div class="sociable">
<div class="sociable_tagline">
Share?
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Fphp-trick-for-bloated-opensource%2F&amp;t=PHP%20Trick%20for%20Bloated%20OpenSource%20Software" title="Facebook"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.designfloat.com/submit.php?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Fphp-trick-for-bloated-opensource%2F&amp;title=PHP%20Trick%20for%20Bloated%20OpenSource%20Software" title="Design Float"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/designfloat.png" title="Design Float" alt="Design Float" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Fphp-trick-for-bloated-opensource%2F&amp;title=PHP%20Trick%20for%20Bloated%20OpenSource%20Software&amp;notes=If%20your%20anything%20like%20me%20nothing%20is%20great%20until%20you%E2%80%99ve%20hacked%20it%20apart.%20However%20with%20OpenSource%20software%20many%20times%20your%20hacks%20and%20mods%20will%20be%20overwritten%20every%20time%20you%20upgrade%20to%20the%20latest%20and%20greatest.%20So%20how%20can%20one%20combat%20this%20task%20with%20litt" title="del.icio.us"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Fphp-trick-for-bloated-opensource%2F&amp;title=PHP%20Trick%20for%20Bloated%20OpenSource%20Software" title="StumbleUpon"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Fphp-trick-for-bloated-opensource%2F" title="Technorati"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.mediaextra.net%2F2008%2Fscripting%2Fphp%2Fphp-trick-for-bloated-opensource%2F&amp;title=PHP%20Trick%20for%20Bloated%20OpenSource%20Software&amp;bodytext=If%20your%20anything%20like%20me%20nothing%20is%20great%20until%20you%E2%80%99ve%20hacked%20it%20apart.%20However%20with%20OpenSource%20software%20many%20times%20your%20hacks%20and%20mods%20will%20be%20overwritten%20every%20time%20you%20upgrade%20to%20the%20latest%20and%20greatest.%20So%20how%20can%20one%20combat%20this%20task%20with%20litt" title="Digg"><img src="http://www.mediaextra.net/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.mediaextra.net/2008/scripting/php/php-trick-for-bloated-opensource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
