<?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>DynamiX Labs &#187; php</title>
	<atom:link href="http://www.dynamixlabs.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dynamixlabs.com</link>
	<description></description>
	<lastBuildDate>Thu, 11 Mar 2010 16:17:26 +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>Goodbye, IE 6. We Won&#8217;t Miss You.</title>
		<link>http://www.dynamixlabs.com/2009/08/07/goodbye-ie-6-we-wont-miss-you/</link>
		<comments>http://www.dynamixlabs.com/2009/08/07/goodbye-ie-6-we-wont-miss-you/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 12:21:02 +0000</pubDate>
		<dc:creator>DynamiXLabs</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Ban IE 6]]></category>
		<category><![CDATA[Goodbye IE 6]]></category>
		<category><![CDATA[IE 6]]></category>
		<category><![CDATA[IE 6 No More]]></category>
		<category><![CDATA[Internet Explorer 6]]></category>

		<guid isPermaLink="false">http://www.dynamixlabs.com/?p=141</guid>
		<description><![CDATA[<div class="floatleft"><img src="http://www.dynamixlabs.com/images/nomoreie6.gif" alt="NO MORE IE 6" /></div>Like all good web developers over the last nine or so years, we have dedicated countless hours to ensuring compatibility with Internet Explorer 6. Replacing our cool PNG effects and shadows with far plainer GIF equivalents, adding completely nonsensical hacks to make IE 6 behave, etc. Well, here's where we make our stand.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.dynamixlabs.com%2F2009%2F08%2F07%2Fgoodbye-ie-6-we-wont-miss-you%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.dynamixlabs.com%2F2009%2F08%2F07%2Fgoodbye-ie-6-we-wont-miss-you%2F&amp;source=dynamixlabs&amp;style=normal&amp;service=bit.ly&amp;space=15" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.dynamixlabs.com/images/IE6-uh-oh.gif" alt="Why are you using a dinosaur to browse the web?" /><br />
Like all good web developers over the last nine or so years, we have dedicated countless hours to ensuring compatibility with the archaic, standards-naive Internet Explorer 6. Well, here&#8217;s where we make our stand. While we are not, at this point willing to jeopardize the visitor experience for our clients by building company web sites that are not IE 6 compliant, we are officially cutting the cord on our own DynamiX Labs web site.</p>
<p><strong>Why Kill IE 6?</strong><br />
Quite simply, because it simply can&#8217;t handle most of the great advances that have come along over the past nine or so years. This includes PNG transparency (yes, it SORT OF works with hacks, but not well, and almost never properly for backgrounds), not to mention any hints of HTML 5. Even such simple areas as fixed positioning are a challenge for IE 6. The point is, IE 6 is forcing web designers to lower their standards, and to not push the envelope in advancing newer technologies. If a designer has a feature in mind that will be a really great addition to a new web site, but will take a great deal of effort to complete, they are likely to bypass it completely if IE 6 can&#8217;t handle it through hacks. That&#8217;s a shame. So let&#8217;s stop the stagnation and keep pushing the envelope, and leave IE 6 behind where it belongs.</p>
<p><strong>The Back Story.</strong><br />
Recently, this site was recreated from the ground up with a brand new design. We spent a lot of time making it look good in standards compliant browsers, only to find that IE 6 (naturally) was a mess. So, after several hours of attempting to make the design appear as it should in IE 6, we had had enough.</p>
<p><strong>What We Did.</strong><br />
We created a small piece of PHP that checks to see what browser, and what version a visitor is using to visit our web site. If using anything other than IE 6, the site will render as normal. But, if a visitor does navigate the web site from IE 6, they will see a completely different header, footer and design (stylesheet driven), in fact the original design that we have had in place for the past several years. In other words, IE 6 is doomed to forever live in the past, while better browsers will continue to move forward as we do.</p>
<p><strong>The End Result.</strong><br />
Here&#8217;s how the site appears in Internet Explorer 6:</p>
<div class="center"><img src="http://www.dynamixlabs.com/images/ie6.jpg" alt="IE 6 looks outdated" /></div>
<p><strong>For anyone still browsing our site in IE 6, here&#8217;s what you are missing out on:</strong></p>
<div class="center"><img src="http://www.dynamixlabs.com/images/ff.jpg" alt="IE 6 looks outdated" /></div>
<p><strong>More Reading.</strong><br />
For emphasis, we added the code from <a href="http://www.ie6nomore.com/">http://www.ie6nomore.com/</a> onto our IE 6 version, letting visitors know that they could be getting so much more than what they are. I encourage all designers to implement this code on their non-client web sites. The time will certainly come when this should be implemented universally, but let&#8217;s get this process moving on our own web sites for the time being. </p>
<p>If you have a client who is of the same mind about IE 6 and is willing to add this to their web site, all the better, but we don&#8217;t suggest forcing this on your clients.</p>
<p><strong style="color:#f00">Big Red Disclaimer:</strong><br />
Yes, we know that there are some companies who have had IE 6 forced upon them. For these people, we&#8217;re sorry, but it&#8217;s time to start pressuring your IT guys to at LEAST allow you use of Firefox, Safari or Chrome in addition to IE 6. There should be no excuse to only allow Internet Explorer 6, particularly since programs that allow multiple versions of IE have been around for years now (see <a href="http://tredosoft.com/Multiple_IE">http://tredosoft.com/Multiple_IE</a> for a great XP-based one). There&#8217;s even a hack for Vista users. So, the question to ask your IT guys is, <em><strong>WHY only IE 6?</strong></em></p>
<p><strong>Looking forward to the comments and criticisms!</strong></p>
<div class="sexy-bookmarks sexy-bookmarks-expand"><ul class="socials"><li class="sexy-twitter"><a href="http://www.twitter.com/home?status=Goodbye%2C+IE+6.+We+Won%26%238217%3Bt+Miss+You.+-+http://www.dynamixlabs.com/141" rel="normal nofollow" title="Tweet This!">Tweet This!</a></li><li class="sexy-digg"><a href="http://digg.com/submit?phase=2&amp;url=http://www.dynamixlabs.com/2009/08/07/goodbye-ie-6-we-wont-miss-you/&amp;title=Goodbye%2C+IE+6.+We+Won%26%238217%3Bt+Miss+You." rel="normal nofollow" title="Digg this!">Digg this!</a></li><li class="sexy-stumbleupon"><a href="http://www.stumbleupon.com/submit?url=http://www.dynamixlabs.com/2009/08/07/goodbye-ie-6-we-wont-miss-you/&amp;title=Goodbye%2C+IE+6.+We+Won%26%238217%3Bt+Miss+You." rel="normal nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li class="sexy-technorati"><a href="http://technorati.com/faves?add=http://www.dynamixlabs.com/2009/08/07/goodbye-ie-6-we-wont-miss-you/" rel="normal nofollow" title="Share this on Technorati">Share this on Technorati</a></li><li class="sexy-facebook"><a href="http://www.facebook.com/share.php?u=http://www.dynamixlabs.com/2009/08/07/goodbye-ie-6-we-wont-miss-you/&amp;t=Goodbye%2C+IE+6.+We+Won%26%238217%3Bt+Miss+You." rel="normal nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li class="sexy-mail"><a href="mailto:?&amp;subject=Goodbye%2C%20IE%206.%20We%20Won%26%238217%3Bt%20Miss%20You.&amp;body=%0D%0ALike%20all%20good%20web%20developers%20over%20the%20last%20nine%20or%20so%20years%2C%20we%20have%20dedicated%20countless%20hours%20to%20ensuring%20compatibility%20with%20the%20archaic%2C%20standards-naive%20Internet%20Explorer%206.%20Well%2C%20here%27s%20where%20we%20make%20our%20stand.%20While%20we%20are%20not%2C%20at%20this%20point%20willing%20to%20jeopardize%20the%20visitor%20experience%20for%20our - http://www.dynamixlabs.com/2009/08/07/goodbye-ie-6-we-wont-miss-you/" rel="normal nofollow" title="Email this to a friend?">Email this to a friend?</a></li><li class="sexy-comfeed"><a href="http://www.dynamixlabs.com/2009/08/07/goodbye-ie-6-we-wont-miss-you/feed" rel="normal nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a></li></ul><div style="clear:both;"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.dynamixlabs.com/2009/08/07/goodbye-ie-6-we-wont-miss-you/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>php: a simple way to fight SPAM on your contact form</title>
		<link>http://www.dynamixlabs.com/2008/03/26/php-a-simple-way-to-fight-spam-on-your-contact-form/</link>
		<comments>http://www.dynamixlabs.com/2008/03/26/php-a-simple-way-to-fight-spam-on-your-contact-form/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 16:21:20 +0000</pubDate>
		<dc:creator>DynamiXLabs</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[contact us form]]></category>
		<category><![CDATA[fight spam]]></category>
		<category><![CDATA[prevent spammers]]></category>

		<guid isPermaLink="false">http://www.dynamixlabs.com/2008/03/26/php-a-simple-way-to-fight-spam-on-your-contact-form/</guid>
		<description><![CDATA[
			
				
			
		
Contact forms are a vital part of a business&#8217; website. Your content is useless if you do not have a way for potential customers to contact you. &#8216;Back in the day&#8217;, it was a generally accepted practice to simply put your email address(es) on the site. However, spammers quickly found an easy target for their [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.dynamixlabs.com%2F2008%2F03%2F26%2Fphp-a-simple-way-to-fight-spam-on-your-contact-form%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.dynamixlabs.com%2F2008%2F03%2F26%2Fphp-a-simple-way-to-fight-spam-on-your-contact-form%2F&amp;source=dynamixlabs&amp;style=normal&amp;service=bit.ly&amp;space=15" height="61" width="50" /><br />
			</a>
		</div>
<p>Contact forms are a vital part of a business&#8217; website. Your content is useless if you do not have a way for potential customers to contact you. &#8216;Back in the day&#8217;, it was a generally accepted practice to simply put your email address(es) on the site. However, spammers quickly found an easy target for their junk emails.</p>
<p><strong>Enter the &#8216;Contact Form&#8217;.</strong></p>
<p>Contact forms provided a means by which customers could send you a message without knowing your email address. These forms also keep people on your site, instead of sending them away to write a message in their preferred email program (or site). Sadly, spammers have now found a way to send a message through these contact forms. Many forms have simple data validation, which requires that you fill out specific fields with specific information (phone number, email address, etc). Other forms use CAPTCHA tests, which provide an image of text that the visitor must re-type into a field on the form. While this works well for responses on blog sites or registering for an online community, we don&#8217;t feel that it is appropriate for the average business website.</p>
<p>So, after some thought, we decided to try some &#8216;negative validation&#8217;. Instead of having more required fields, we created a field that must be empty, then we used simple CSS to hide that field from human visitors. Because the spam bots have learned to fill out every single field on a contact form, they will see this field in the code and put something in it and our form will know to simply reject this message.</p>
<p><strong>Enough talk, lets get to the example&#8230; </strong></p>
<p>This code can be added to nearly any php-based contact form.</p>
<p>First, we are going to add a new field to the form itself. It doesn&#8217;t matter where this field is located, as long as it is inside the &lt;form&gt; tags. We originally tried using an arbitrary name for this field, but it did not fool all of the spambots. We decided to rename our real email field and use &#8220;Email&#8221; for this input. At the time of this writing, it has worked for us.</p>
<p><strong>Code:</strong><br />
<code>&lt;div class="email"&gt;&lt;input type="text" name="Email" id="Email" value="" size="20" /&gt;&lt;/div&gt;</code><br />
(If you already have a class named &#8220;.email&#8221;, please rename class=&#8221;email&#8221; as you see fit)</p>
<p>At first, this simple field will be visible because you will want to test it before hiding it.</p>
<p>Next, we need to look at the form action value. This will tell us where the form submits to. Our contact forms submit to themselves (contact.php submits to contact.php) and all of the server-side code used to send the email is at the top of the code (above the &lt;html&gt; tag).</p>
<p>Once we have located the code that actually sends the message, we need to put it inside a simple if-statement around the code that specifically executes sending the e-mail. Every contact form is different, so we must assume that you know how your specific form works.</p>
<p><strong>Code:</strong><br />
<code>&lt;?php if ($_POST['Email'] == '') {<br />
Put your 'send the message' code here;<br />
} ?&gt;</code><br />
We decided to take it a step further. Instead of simply not allowing the &#8217;send the message&#8217; code to be executed, we decided to send the spambots away from our site.</p>
<p><strong>Code:</strong><br />
<code>&lt;?php if ($_POST['Email'] == '') {<br />
Put your 'send the message' code here;<br />
} else { header( 'Location: http://www.google.com/' ); } ?&gt;</code><br />
In this example, we just sent them to Google, but you are free to send them wherever you like.</p>
<p>Now that we have added the new field and conditional region, we can go ahead and load the contact page in the browser. Fill out the form however you like and make sure to type something (anything) into that new field. Submit the form and you should be instantly re-directed to Google.</p>
<p>Lastly, we need to return to the new field. To make sure that it is not visible to humans, we need to apply a little bit of CSS. Originally, we used &#8220;display:none;&#8221;, but learned that the spambots already knew this trick, so we had to resort to some different code. Unfortunately, the time may come where the spambots learn this trick, but for the time being, it works just fine.</p>
<p>Open your stylesheet and add this line:</p>
<p><strong>Code:</strong><br />
<code>.email {position:absolute;margin-left:-5000px;}</code></p>
<p>After saving the stylesheet, reload your form, and you will see that the field is hidden. Submit your contact form and you should get an email, just like before.</p>
<p><strong>Compatibility:</strong><br />
This method should apply to virtually any php contact form. If you find a compatibility issue, we would love to hear it!</p>
<p><strong>That’s all folks!</strong><br />
If you have an idea or article that you would like to contribute, send it on! We’re always looking for good, quality articles. Note that we will not republish an article that has been published elsewhere, so keep it original!</p>
<div class="sexy-bookmarks sexy-bookmarks-expand"><ul class="socials"><li class="sexy-twitter"><a href="http://www.twitter.com/home?status=php:+a+simple+way+to+fight+SPAM+on+your+contact+form+-+http://www.dynamixlabs.com/19" rel="normal nofollow" title="Tweet This!">Tweet This!</a></li><li class="sexy-digg"><a href="http://digg.com/submit?phase=2&amp;url=http://www.dynamixlabs.com/2008/03/26/php-a-simple-way-to-fight-spam-on-your-contact-form/&amp;title=php:+a+simple+way+to+fight+SPAM+on+your+contact+form" rel="normal nofollow" title="Digg this!">Digg this!</a></li><li class="sexy-stumbleupon"><a href="http://www.stumbleupon.com/submit?url=http://www.dynamixlabs.com/2008/03/26/php-a-simple-way-to-fight-spam-on-your-contact-form/&amp;title=php:+a+simple+way+to+fight+SPAM+on+your+contact+form" rel="normal nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li class="sexy-technorati"><a href="http://technorati.com/faves?add=http://www.dynamixlabs.com/2008/03/26/php-a-simple-way-to-fight-spam-on-your-contact-form/" rel="normal nofollow" title="Share this on Technorati">Share this on Technorati</a></li><li class="sexy-facebook"><a href="http://www.facebook.com/share.php?u=http://www.dynamixlabs.com/2008/03/26/php-a-simple-way-to-fight-spam-on-your-contact-form/&amp;t=php:+a+simple+way+to+fight+SPAM+on+your+contact+form" rel="normal nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li class="sexy-mail"><a href="mailto:?&amp;subject=php%3A%20a%20simple%20way%20to%20fight%20SPAM%20on%20your%20contact%20form&amp;body=Contact%20forms%20are%20a%20vital%20part%20of%20a%20business%27%20website.%20Your%20content%20is%20useless%20if%20you%20do%20not%20have%20a%20way%20for%20potential%20customers%20to%20contact%20you.%20%27Back%20in%20the%20day%27%2C%20it%20was%20a%20generally%20accepted%20practice%20to%20simply%20put%20your%20email%20address%28es%29%20on%20the%20site.%20However%2C%20spammers%20quickly%20found%20an%20easy%20target%20for - http://www.dynamixlabs.com/2008/03/26/php-a-simple-way-to-fight-spam-on-your-contact-form/" rel="normal nofollow" title="Email this to a friend?">Email this to a friend?</a></li><li class="sexy-comfeed"><a href="http://www.dynamixlabs.com/2008/03/26/php-a-simple-way-to-fight-spam-on-your-contact-form/feed" rel="normal nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a></li></ul><div style="clear:both;"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.dynamixlabs.com/2008/03/26/php-a-simple-way-to-fight-spam-on-your-contact-form/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>php: IF versus SWITCH</title>
		<link>http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/</link>
		<comments>http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 16:18:50 +0000</pubDate>
		<dc:creator>DynamiXLabs</dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/</guid>
		<description><![CDATA[
			
				
			
		
Often times, a PHP developer will need to display different information depending on the circumstances. In the case of our SE Content Management System, there are dozens of these scenarios: from where to display the image gallery on a particular page to whether or not to show breadcrumbs. In every instance, we have to determine [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.dynamixlabs.com%2F2008%2F01%2F29%2Fphp-if-versus-switch%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.dynamixlabs.com%2F2008%2F01%2F29%2Fphp-if-versus-switch%2F&amp;source=dynamixlabs&amp;style=normal&amp;service=bit.ly&amp;space=15" height="61" width="50" /><br />
			</a>
		</div>
<p>Often times, a PHP developer will need to display different information depending on the circumstances. In the case of our <a href="http://www.about-se.com">SE Content Management System</a>, there are dozens of these scenarios: from where to display the image gallery on a particular page to whether or not to show breadcrumbs. In every instance, we have to determine how to evaluate the situation. Is it a simple show or don&#8217;t show item, or are there several possible outcomes?</p>
<p>In this example, we will be using the months of the year as our &#8216;variable&#8217;.</p>
<p>First we must define the current month:</p>
<p><strong>php:</strong><code>&lt;?php $currentmonth = date("m"); ?&gt;</code>Now, if we wanted to introduce special code in only one month, such as saying &#8216;Happy New Year&#8217; in January, then an IF statement would work just fine:</p>
<p><strong>php:</strong><code>&lt;?php if ($currentmonth == '01') { ?&gt;<br />
&lt;strong&gt;Happy New Year!&lt;/strong&gt;<br />
&lt;?php } ?&gt;</code>You see that the if statement is always enclosed in parenthesis and the result is always enclosed in squiggly brackets. In this example, we chose to output in HTML, so we had to close and re-open our php tags. We could have also chosen to do this:</p>
<p><strong>php:</strong><code>&lt;?php if ($currentmonth == '01') {<br />
echo "Happy New Year!";<br />
} ?&gt;</code>Lets say that you needed a &#8216;Happy New Year&#8217; for January, &#8216;Happy Valentines Day&#8217; for February, &#8216;Happy Thanksgiving&#8217; for November and &#8216;Merry Christmas&#8217; for December. An If statement is not practical for this situation, so we need to use the php SWITCH statement instead.  With a switch statement, we first present the variable:</p>
<p><strong>php:</strong><code>&lt;?php switch ($currentmonth) {</code>Next, we present each &#8216;case&#8217;, followed by the intended output and a break. Lets start with January, which is &#8216;01&#8242;:</p>
<p><strong>php:</strong><code>case 01:<br />
echo "Happy New Year";<br />
break;</code></p>
<p>Now, lets put it all together:</p>
<p><strong>php:</strong><code>&lt;?php switch ($currentmonth) {<br />
case 01:<br />
echo "Happy New Year";<br />
break;</p>
<p>case 02:<br />
echo "Happy Valentines";<br />
break;</p>
<p>case 11:<br />
echo "Happy Thanksgiving";<br />
break;</p>
<p>case 12:<br />
echo "Merry Christmas";<br />
break;</p>
<p>default:<br />
echo "Just another month...";<br />
}<br />
?&gt;</code></p>
<p>You see that we also added a &#8216;default&#8217; condition for all other months. This is, of course not required, but it is often useful.</p>
<p><strong>Compatibility:</strong><br />
As this is a php tutorial, a php-capable server is required for this code to function properly.</p>
<p><strong>That’s all folks!</strong><br />
If you have an idea or article that you would like to contribute, send it on! We’re always looking for good, quality articles. Note that we will not republish an article that has been published elsewhere, so keep it original!</p>
<div class="sexy-bookmarks sexy-bookmarks-expand"><ul class="socials"><li class="sexy-twitter"><a href="http://www.twitter.com/home?status=php:+IF+versus+SWITCH+-+http://www.dynamixlabs.com/15" rel="normal nofollow" title="Tweet This!">Tweet This!</a></li><li class="sexy-digg"><a href="http://digg.com/submit?phase=2&amp;url=http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/&amp;title=php:+IF+versus+SWITCH" rel="normal nofollow" title="Digg this!">Digg this!</a></li><li class="sexy-stumbleupon"><a href="http://www.stumbleupon.com/submit?url=http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/&amp;title=php:+IF+versus+SWITCH" rel="normal nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li class="sexy-technorati"><a href="http://technorati.com/faves?add=http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/" rel="normal nofollow" title="Share this on Technorati">Share this on Technorati</a></li><li class="sexy-facebook"><a href="http://www.facebook.com/share.php?u=http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/&amp;t=php:+IF+versus+SWITCH" rel="normal nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li class="sexy-mail"><a href="mailto:?&amp;subject=php%3A%20IF%20versus%20SWITCH&amp;body=Often%20times%2C%20a%20PHP%20developer%20will%20need%20to%20display%20different%20information%20depending%20on%20the%20circumstances.%20In%20the%20case%20of%20our%20SE%20Content%20Management%20System%2C%20there%20are%20dozens%20of%20these%20scenarios%3A%20from%20where%20to%20display%20the%20image%20gallery%20on%20a%20particular%20page%20to%20whether%20or%20not%20to%20show%20breadcrumbs.%20In%20every%20i - http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/" rel="normal nofollow" title="Email this to a friend?">Email this to a friend?</a></li><li class="sexy-comfeed"><a href="http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/feed" rel="normal nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a></li></ul><div style="clear:both;"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.dynamixlabs.com/2008/01/29/php-if-versus-switch/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>php: keeping your site&#8217;s copyright up to date</title>
		<link>http://www.dynamixlabs.com/2008/01/17/php-keeping-your-sites-copyright-up-to-date/</link>
		<comments>http://www.dynamixlabs.com/2008/01/17/php-keeping-your-sites-copyright-up-to-date/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 21:17:10 +0000</pubDate>
		<dc:creator>DynamiXLabs</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[copyright]]></category>

		<guid isPermaLink="false">http://www.dynamixlabs.com/2008/01/17/php-keeping-your-sites-copyright-up-to-date/</guid>
		<description><![CDATA[
			
				
			
		
This one is very quick and easy, but can save you a great deal of time if you have more than one web site, or if your web site consists of static pages rather than dynamic ones. Enough talking, let&#8217;s get into what&#8217;s involved:
For PHP:
If you use PHP on your web site, then you can [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.dynamixlabs.com%2F2008%2F01%2F17%2Fphp-keeping-your-sites-copyright-up-to-date%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.dynamixlabs.com%2F2008%2F01%2F17%2Fphp-keeping-your-sites-copyright-up-to-date%2F&amp;source=dynamixlabs&amp;style=normal&amp;service=bit.ly&amp;space=15" height="61" width="50" /><br />
			</a>
		</div>
<p>This one is very quick and easy, but can save you a great deal of time if you have more than one web site, or if your web site consists of static pages rather than dynamic ones. Enough talking, let&#8217;s get into what&#8217;s involved:</p>
<p><strong>For PHP:</strong><br />
If you use PHP on your web site, then you can include this line in your footer.txt (or equivalent file) to achieve the desired result:<br />
<code>Copyright © &lt;?php echo date('Y'); ?&gt; Your Company Name, Inc.</code></p>
<p><strong>For ASP:</strong><br />
Ditto with ASP, this code will get you going.<br />
<code>Copyright © &lt;%=year(date)%&gt; Your Company Name, Inc.</code></p>
<p>Now remember, these won&#8217;t work on plain .html pages, or on a server that does not support PHP or ASP.</p>
<p><strong>That’s all folks!</strong></p>
<p>If you have an idea or article that you would like to contribute, send it on! We’re always looking for good, quality articles. Note that we will not republish an article that has been published elsewhere, so keep it original!</p>
<div class="sexy-bookmarks sexy-bookmarks-expand"><ul class="socials"><li class="sexy-twitter"><a href="http://www.twitter.com/home?status=php:+keeping+your+site%26%238217%3Bs+copyright+up+to+date+-+http://www.dynamixlabs.com/6" rel="normal nofollow" title="Tweet This!">Tweet This!</a></li><li class="sexy-digg"><a href="http://digg.com/submit?phase=2&amp;url=http://www.dynamixlabs.com/2008/01/17/php-keeping-your-sites-copyright-up-to-date/&amp;title=php:+keeping+your+site%26%238217%3Bs+copyright+up+to+date" rel="normal nofollow" title="Digg this!">Digg this!</a></li><li class="sexy-stumbleupon"><a href="http://www.stumbleupon.com/submit?url=http://www.dynamixlabs.com/2008/01/17/php-keeping-your-sites-copyright-up-to-date/&amp;title=php:+keeping+your+site%26%238217%3Bs+copyright+up+to+date" rel="normal nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li class="sexy-technorati"><a href="http://technorati.com/faves?add=http://www.dynamixlabs.com/2008/01/17/php-keeping-your-sites-copyright-up-to-date/" rel="normal nofollow" title="Share this on Technorati">Share this on Technorati</a></li><li class="sexy-facebook"><a href="http://www.facebook.com/share.php?u=http://www.dynamixlabs.com/2008/01/17/php-keeping-your-sites-copyright-up-to-date/&amp;t=php:+keeping+your+site%26%238217%3Bs+copyright+up+to+date" rel="normal nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li class="sexy-mail"><a href="mailto:?&amp;subject=php%3A%20keeping%20your%20site%26%238217%3Bs%20copyright%20up%20to%20date&amp;body=This%20one%20is%20very%20quick%20and%20easy%2C%20but%20can%20save%20you%20a%20great%20deal%20of%20time%20if%20you%20have%20more%20than%20one%20web%20site%2C%20or%20if%20your%20web%20site%20consists%20of%20static%20pages%20rather%20than%20dynamic%20ones.%20Enough%20talking%2C%20let%27s%20get%20into%20what%27s%20involved%3A%0D%0A%0D%0AFor%20PHP%3A%0D%0AIf%20you%20use%20PHP%20on%20your%20web%20site%2C%20then%20you%20can%20include%20this%20li - http://www.dynamixlabs.com/2008/01/17/php-keeping-your-sites-copyright-up-to-date/" rel="normal nofollow" title="Email this to a friend?">Email this to a friend?</a></li><li class="sexy-comfeed"><a href="http://www.dynamixlabs.com/2008/01/17/php-keeping-your-sites-copyright-up-to-date/feed" rel="normal nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a></li></ul><div style="clear:both;"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.dynamixlabs.com/2008/01/17/php-keeping-your-sites-copyright-up-to-date/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
