If Homepage Statement

Published September 16th 2009
Filed under PHP

In PHP you can use an If Statement to display something on your homepage but something different on the rest of your pages. The search box on Let-Go.net is only displayed only on the homepage but not elsewhere on the site. Below is the code used to do this:

<?php
$uri = $_SERVER['REQUEST_URI'];
if ($uri == "/") {
echo "This is the homepage";
} else {
echo "This is not the homepage";
}
?>

You can change the echos to a line of code or replace them with a PHP include.

HTML If Conditions & Statements

Published September 16th 2009
Filed under HTML

Like Java and other programming languages, HTML also has its own set of If Conditions and Statements. They’re really simple to use and are useful if you want to have a page look the best it can in different browsers.

For example, Internet Explorer 6 and below can’t handle transparent PNG images but Internet Explorer 7 and above can, so you may want to remove the transparent PNG in Internet Explorer 6 and below.

To do this, you can use the following If Statements:

<!--[if gt IE 7]>
<TABLE style="background: url(images/gradient.png);" BORDER="0" CELLPADDING="0" CELLSPACING="0">
<![endif]-->

This code is read as it’s written. It means if the browser you’re using is greater than Internet Explorer 7, use the PNG image background. Internet Explorer 6 and below will not use the PNG background.

Read the rest of this story »

Portfolio Update & New Annie Layout

Published September 15th 2009
Filed under Portfolio

I’ve updated my Portfolio to include all the recent layouts I’ve made. You can check them out by clicking here. I’ve also added a new layout to Anniemaniac which you can view by clicking on the picture below: