Tag Archives: php code

Recommended Php-code

Web Server Hack – How To Auto Restart HTTPD service script!

Here’s a simple script I made up that will auto restart your HTTPD service if it reaches a high load.

The script will actually stop your HTTPD server when your load is higher than the maximum load settings and will re-start when the load is back to zero.

If you are on a server that’s overloaded, this script can help you “temporarily” get by instead of your web server dying and you manually rebooting your web server.

There’s also an extra “mail” feature that will email you whenever the server is stopped or restarted. (Code after

Click Here to Read Full Article

10 Comments

PHP DIY – How to Add RSS Feeds to Any Website/Blog using Magpie RSS Parser!

One of the most common things we do in today’s Web2.0 programming are RSS feeds.  Now there’s a bunch of ways you can add RSS feeds to your website but let me tell you the BEST way using PHP.

1) Download and unzip Magpie RSS in your website root directory somewhere.

2) Anywhere in your PHP code, add the following line, while making sure the full directory path is specified.  (I usually like to put it in directory such as “magpie”)

require('rss_fetch.inc'); $myurl="http://ze

Click Here to Read Full Article

6 Comments

PHP DIY – How to Add Caching to ANY website!

In my recent ventures, I have resorted to finding great PHP code to cache my website.

Even if you are not using WordPress, you can still make a simple PHP caching mechanism without the use of WordPress Super Cache.  (Well, all WordPress Super Cache is a PHP cache with user-friendly menus.)

Here’s how to add caching to your website:

Copy and paste the following code and save as “cache.php” in your website root directory:

<?php // Settings $cachedir = ‘cache/’; // Directory to cache files in (keep outside web root) $cachetime = 600

Click Here to Read Full Article

3 Comments