How to pipe logs from Apache to PHP / How to seperate Apache log files with PHP

I recently needed to do this for a client to customise and merge the logged data from Apache into a presentable format. A by-product of this was the ability to also roll the log file on a daily basis.I found limited information regarding how to do this most of which were methods that were faulty […]

Preventing HTTP TRACE Method Cross Site Scripting Attacks

What is a cross site scripting attack?: “Cross-site scripting (XSS) is a simple idea at heart: the attacker loads exploitative HTML, including a client-side script, into a web site, typically one which allows public submissions and which does not properly quote HTML tags. Any user of the site who reads the story loads the exploit […]

PHP: How to insert value into array

[notice]As this is one of the most hit articles on the site, I’ve decided to update and build on it, it is now targeted at PHP 5.0+.[/notice] There are two ‘main’ forms of arrays within PHP, these are numerical (or zero based) and associative arrays. Creating a new array The code below demonstrates creating a […]