Add RSS feeds to your website

Adding a RSS feed to your website has never been this easy with PHP, especially with MagpieRSS. About MagpieRSS MagpieRSS is an RSS and Atom parser for PHP which supports RSS 0.9, RSS 1.0, the various Userland RSS versions (0.9x and 2.0). Additionally it supports Atom 0.3, and many custom RSS namespaces. Features of MagpieRSS Easy to Use Parses … Continue reading Add RSS feeds to your website

Geolocate your visitors with PHP (part 2)

In the first part of this series I showed how you could get the country of a visitor via his IP address. Now with this precious information, I’ll show you how to map the visitor visually on the world map using Google Maps. You must sign up for a Google Maps API key if you don’t already have one. … Continue reading Geolocate your visitors with PHP (part 2)

SEO friendly URL in PHP

When I started implementing mod_rewrite in websites I had a problem in PHP as how to make a SEO friendly URL. All tutorials were geared towards how to implement mod_rewrite, about modifying .htaccess files, but none treated how to make the urls friendly with dynamic content. For example I have a news section which are pulled from the database, … Continue reading SEO friendly URL in PHP

Expanding/collapsing javascript menu

In this post I’ll show you how to create an expanding/collapsing menu like Slashdot left menu used to be, using the YUI library and Dav GlassYUI effects widget. The HTML markup for our menu is : <div id=”menu”> <h1 id=”menu-title”>Menu</h1> <div id=”menu-links”> <ul> <li>Home</li> <li>About</li> <li>CSS</li> </ul> </div> </div> We use 2 div tags, one for holding the menu itself and the … Continue reading Expanding/collapsing javascript menu

YUI-based numeric stepper widget

Since I had some problems with YUI slider, I decided to write a YUI-based numeric stepper that allows users to select values within a predefined range. To instantiate the widget include the following files : <!– CSS –> <link rel=”stylesheet” type=”text/css” href=”stepper/stepper.css” /> <!– Dependencies –> <script type=”text/javascript” src=”http://yui.yahooapis.com/2.5.2/build/yahoo-dom-event/yahoo-dom-event.js”></script> <!– Stepper source file –> <script type=”text/javascript” src=”stepper/stepper-min.js”></script> Then … Continue reading YUI-based numeric stepper widget

Geolocate your visitors with PHP (part 1)

In this short post, I’ll show you how to geolocate your visitors with PHP. First of all let’s have a look at what you’ll need : PEAR GeoIP MaxMind GeoLite Country Installing PEAR GeoIP Using your console or using the command prompt type : pear install http://download.pear.php.net/package/Net_GeoIP-1.0.0RC1.tgz If you used our 70% off coupon for Bluehost … Continue reading Geolocate your visitors with PHP (part 1)

HTML entities within XSL

You want to have in your XSL stylesheet but you’re getting an error, just put these few lines of code at the top, before the tag : <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp “&#160;”> <!ENTITY AElig “&#198;”> <!ENTITY AMP “&amp;#38;”> <!ENTITY Aacute “&#193;”> <!ENTITY Acirc “&#194;”> <!ENTITY Agrave “&#192;”> <!ENTITY Alpha “&#913;”> <!ENTITY Aring “&#197;”> <!ENTITY … Continue reading HTML entities within XSL

10 starting signs of a good web developer (php version)

Nowadays many people call themselves PHP programmers / web developers as soon as they know a bit of Frontpage or using Dreamweaver to generate the code for them. But are they really good web developers? Here’s my top 10 characteristics of good web developers, feel free to comment. 1. Ability to hand code Instead of … Continue reading 10 starting signs of a good web developer (php version)

Simple YUI Cookie example – javascript text magnifier for your page

Since YUI 2.5.0 there’s the Cookie utility and at this time of posting, it’s still in beta version. I’ll show you how we can use this simple utility to write a small javascript app. The piece of code we will be writing, using the YUI library (my favorite), will allow users to increase/decrease their font size for a block … Continue reading Simple YUI Cookie example – javascript text magnifier for your page

htaccess Cheatsheet

Here is a simple cheatsheet for the .htaccess file: Enable Directory Browsing Options +Indexes ## block a few types of files from showing IndexIgnore *.wmv *.mp4 *.avi Disable Directory Browsing Options All -Indexes Customize Error Messages ErrorDocument 403 /forbidden.html ErrorDocument 404 /notfound.html ErrorDocument 500 /servererror.html Get SSI working with HTML/SHTML AddType text/html .html AddType text/html .shtml AddHandler … Continue reading htaccess Cheatsheet