Category: "PHP"

PHP File Upload Example

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

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

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

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

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 »