Category Archives: PHP

PHP Database Based Session Handling


Due to a move to a multi-server environment at work to cope with peak time performance I was asked to implement a replacement to PHP’s standard session handling so that sessions would work in this new environment. In PHP 5.4 … Continue reading

Posted in PHP | Tagged Databases, PHP, Sessions | Leave a comment

PHP cURL Wrapper


I’ve put up a gist of a simple PHP cURL wrapper which simplifies basic content fetching with cURL. The class throws standard Exceptions in case of no content being returned or incorrect settings being passed as arguments. Setup:

Simple setters for … Continue reading

Posted in PHP | Tagged cURL, PHP | Leave a comment

Arrays In PHP $_POST / $_GET Values


HTTP requests can of course be spoofed, just because your form says data should be transferred using GET or POST with specified names for element keys, this does not mean someone can’t alter the form before submission or even just use a … Continue reading

Posted in PHP | Tagged forms, PHP, Security, Validation | Leave a comment

PHP Error Handling – Part Two, Standard Error Handling


This is a short post continuing the topic of errors in PHP, following on from error types & exceptions and leading to custom error handling, this post is a quick summary of the standard error reporting provided by PHP. In … Continue reading

Posted in PHP | Tagged Error Handling, PHP | Leave a comment

Zend PHP 5.3 Certification


As of last week I am officially a Zend Certified Engineer (proof) and thought I should post something on preparing for the exam and share some useful resources for others who may be working towards the 5.3 certification. The “Zend … Continue reading

Posted in PHP | Tagged PHP, Zend | 2 Comments

PHP Error Handling – Part One, Error Types & Exceptions


As a study aid whilst working towards Zend Certification and also due to a post on the topic being requested by a colleague (Barry) and after a rant by me after a talk at PHP UK 2012, here is the … Continue reading

Posted in PHP | Tagged Error Handling, Exceptions, PHP | Leave a comment

Facebook Likes, Twitter Follows and Feedburner Count in PHP with cURL/SimpleXML (Deluxe)


So API’s from common providers are unreliable… below is the same code as my previous post but with two layers (1h + 24h) of Alternative PHP Cache (APC) caching and exception handling for the SimpleXML. Worth noting that the code … Continue reading

Posted in PHP | Tagged APC, API, cURL, Facebook, FeedBurner, PHP, SimpleXML, Twitter, XML | 1 Comment

Facebook Likes, Twitter Follows and Feedburner Count in PHP with cURL/SimpleXML


Basic (no error handling) copy and paste code for getting Facebook Likes, Twitter Follows and a Feedburner Subscription count using PHP (with cURL):

Note: PHP must be compiled with cURL: http://uk.php.net/manual/en/curl.installation.php Note: For the Feedburner API request to work you … Continue reading

Posted in PHP | Tagged API, cURL, Facebook, FeedBurner, PHP, SimpleXML, Twitter, XML | 2 Comments