Category: "PHP"

PHP File Upload Example
Feb 1st
This example shows the HTML and PHP to upload a file.
Browsers handle the MAX_FILE_SIZE input and accept attribute differently. Some will filter the files offered through the dialog box to only list those identified by the accept attribute. Some w… more »

Open Source - Cycle Back
Jan 7th
Open Source software is often maturing.
Cycling back to the distribution site has many advantages:
Upgrading open source components usually delivers many bug fixes and new features. Although upgrading after ever update is probably unnecessary, i… more »

PHP Session Development Strategies
Dec 29th
Use Firebug to get the session id off the page requests.
Find the directory session files are stored in. On busy, shared servers, this is often /tmp. Check /etc/php.ini or possibly /etc/httpd/conf.d/php.conf.
To simulate a session timeout on the serv… more »

Monitor Script Execution with PHP
Dec 22nd
The following is a very simple script that can be used as a framework to monitor the execution of a script.
Comments are used for explanation.
<?php
/* Ensure the viewer has logged in. */
session_start();
if (!isset($_SESSION['bLogged_in']))… more »

MySQL REGEXP Validation / Error Handling
Nov 19th
Allowing users to run regular expression (REGEXP) searches through a web interface provides excellent search capabilities with very little engineering. One need only change WHERE `field`='value' to WHERE `field` REGEXP 'regex'.
A problem arises if th… more »