PHP : Simple Graphical Hit Counter

PHP Logo Like said in the post before Yesterday evening I have been working on this tutorial, I think that the ease of use of this counter will make it so special, you can implent it anywhere on the website just by calling a file as an image! confused? I show you :
<img src=’counter/counter.php’ />
See that? we are calling an PHP file as an image. The end result is an smooth looking image that shows how many times an page or website has been seen,just like This script will work on almost any server, the only requirements are to have the GD Library installed on the server.

Read the rest of this article

Tags: , ,

PHP : Foreach function for multi level array’s

PHP Logo Valerie Joy posted an article about Array’s on her blog. She handles the basics of array construction and how to translate the array to string with the php build-in foreach function.
Now it would be nice to show you how to handle multi-level array’s and how you can construct an function to translate these array’s to string.

Read the rest of this article

Tags: , , ,

PHP : Smallest RSS feed script

PHP Logohi, normally when I need to fetch an RSS feed in private project I used some old script based on the php function fopen. But with my current Host (Dreamhost) fopen is dissables for various security reason, they however adviced to use the cURL library, I wasn’t familiar with it but after some reading and testing I’ve build an super small feedreader, well see for yourself . (Oh and you need to have the XML parser module installed on your server).

Read the rest of this article

Tags: , , , ,

Wildcard DNS and PHP

I’ve always been wondering how it works, and I’ve finally found out how it does. I will give a few simple examples how it works and how you can use it.

Step one : Make sure your server/domain allows wildcard DNS and that it is enabled on your server/domain.

Step two : Lets create a file called index.php

now before I continue with step 3, it is nice to know that the wildcard subdomain forwards to the index.php on the main domain so all the following domain pont to the same file.

  • foo.domain.com
  • bar.domain.com
  • foobar.domain.com

Read the rest of this article

Tags: , , ,