Archive for the 'PHP' Category

How to get rid of error or warning messages output by PHP in a programatic way for a production PHP web app

Lets say you’re on a shared hosting, or you’re only a programmer which you have NO control at all on the error warning messages output by PHP, such as those E_WARNING, E_ALL, E_STRICT etc.

Continue reading ‘How to get rid of error or warning messages output by PHP in a programatic way for a production PHP web app’

How to write your own cloaking detector in PHP

Cloaking is black hat SEO that we always hate, especially running wordpress that always gets hacked with spam links injection at the bottom of your footer page.

Continue reading ‘How to write your own cloaking detector in PHP’

Encode movie in FLV Flash video on your webpage

In order for a video clip to be shown on a webpage, you’ll need to convert it to a FLV flash format, which the file has the .flv extension

Continue reading ‘Encode movie in FLV Flash video on your webpage’

Ajax shopping cart, built using PHP + Prototype

Ajax is getting popular these days. Many would wanna convert their traditional shopping carts for their online stores into Ajax-driven, which needent page refresh. A tutorial example has been posted on PHPBuilder how to use Prototype on the JavaScript client side, to make ajax remote calls and PHP on the server to store the cart items.

Continue reading ‘Ajax shopping cart, built using PHP + Prototype’

PHP + Rsync + MySQL – building your own data/file remote syncing app

This is to show you how you can build a little rsync app in PHP that is to be run by a Linux/Unix cron job that syncs files on your data or web server to a remote server. PHP is allowed to execute the Unix/Linux system commands such as “rsync” and it gives you the easiness of accessing database such as MySQL.

Continue reading ‘PHP + Rsync + MySQL – building your own data/file remote syncing app’

Beware of remote code injection exploit in PHP!

PHP is kind of convenient to build web pages that have common header and footer. This is the technique we normally use when coming to building corporate web sites to maintain same look and feel over the entire websites. For example in the following piece of code (index.php), it shows you how it’s used.

The index.php
<?php
      $page = $_REQUEST['p'].”.inc.php”;
      include “header.inc.php”;
      include $page;
      include “footer.inc.php”;
?>

Continue reading ‘Beware of remote code injection exploit in PHP!’