Posts Tagged Code Lt
Joomla detect if home page
Posted by in PHP code on July 19th, 2009
To detect if current page is Joomla hage page, do this code:
$uri = $_SERVER['REQUEST_URI'];
if ($uri == “/”) {
echo “You’re on the homepage”;
}
?>
How to use different css on different browser
Cross Browser Compatibility is a huge issue in the website development with many browsers in the market. But luckily most of them uses Internet Explorer and Firefox. Sometimes different version of browser also have different output like the display in IE8 and IE6. To tackle this you can use different css for different browser.
Here’s the code:
<style type=”text/css” media=”screen”>
@import “ie.css”;
</style>
<![endif]–>
- lte IE 6 -> IE 6 and all version lower
- lt IE 6 -> version below IE 6
- IE 6 -> only IE 6
- gt IE 6 -> version higher IE 6
- gte IE 6 -> IE 6 and all version higher
Google maps code sample
Posted by in PHP code on June 20th, 2009
This article is a sample for google maps. You just need to download the code here. In the example, I show Google Headquarters in Google Maps. But before you download, you need to sign up for Google Maps API here and get a key that you will use in the code. From the code that you have download, find the following code:
<script src=”http://maps.google.com/maps?file=api&v=2&key=change-this-to-your-google-api” type=”text/javascript”></script>
and change “change-this-to-your-google-api” to your key. If you have any problem just comment below.










