PHP 4.x Archives
phpMyEdit:
generates PHP code for displaying/editing MySQL tables in HTML. All you need to do is to write a simple calling program (a utility to do this is included). It includes a huge set of table manipulation functions (record addition, change, view, copy, and removal), table sorting, filtering, table lookups, and more.
Download (gz).
11-12-2006 | Permanent Link | No Comments | Related Entries: MySQL, PHP 4.x
Though the screenshots have changed the basic process is the same, Kevin Hemenway, takes readers through how to setup an Apache server on Mac OS X and then how to turn on PHP 4.
To edit the httpd.conf I needed to do the following:
1. start Terminal by going to Utilities/Terminal
2. type the following into the terminal:
sudo […]
04-05-2006 | Permanent Link | No Comments | Related Entries: Installation and configuration, PHP 4.x
Man, how many clicks does it take to get the download these days at Sourceforge? Seems like it took me a half dozen to get to the AjaxMyTop project download.
MyTop creator Jeremy Zawodny writes:
Someone has built and AJAX powered version of mytop, the little console based MySQL monitoring tool I wrote years ago. I guess […]
01-31-2006 | Permanent Link | No Comments | Related Entries: AJAX, Installation and configuration, PHP 5.x, PHP 4.x
Sometimes it is necessary to query data from the last 7 days. Here’s how to create a dynamic query inside a script using PHP / MySQL to return a list of users who last visited within X number of days (7 by default):
<?php
$now = time(); // this is the current UNIX timestamp for the server
$days […]
10-05-2005 | Permanent Link | No Comments | Related Entries: MySQL, PHP 4.x, Information
I’m not sure how current or updated this is because I found some broken project links (all links below work) but these projects seem promising and worth closer inspection, especially if one is looking to make their PHP scripts run faster.
Turck MMcache:
… a free open source PHP accelerator, optimizer, encoder and dynamic content cache for […]
09-30-2005 | Permanent Link | No Comments | Related Entries: Optimization, Encoding, PHP 4.x
At one of our sites we needed to parse out some names and numbers from a log file. The strings also contained comment text and the order would be mixed format. These types of regular expression parsing can be tricky.
Let’s take a look at the two possible formats of the strings:
FORMAT #1:
[00:02:18][jvastine]7.52..I agree with […]
09-23-2005 | Permanent Link | No Comments | Related Entries: Functions, PHP 5.x, PHP 4.x
The PHP header function allows redirection of the browser, among other cool things.
Example redirecting the browser to php-scripts.com homepage:
<?php
header(”Location: http://www.php-scripts.com/”);
?>
09-22-2005 | Permanent Link | 4 Comments | Related Entries: Functions, PHP 5.x, PHP 4.x, PHP 3.x
Finding out the number of days elapsed from a UNIX timestamp is actually pretty straightforward. If you only know two dates then first you’ll need to convert the date to a UNIX timestamps and then subtract the most recent timestamp from the older timestamp like this:
<?php
$old_timestamp = 1102971600;
$elapsed_seconds = time() - $old_timestamp;
print ‘Seconds elapsed since […]
09-21-2005 | Permanent Link | No Comments | Related Entries: Linux, PHP 5.x, PHP 4.x, PHP 3.x, Information
<?php
$string = “?This is a test that should be in single quotes quotes?”;
$text = preg_replace(”/(\?([^\?]+)\?)/”,”‘\\2′”,$string);
?>
regular expression produces:
This is a test that should be in single quotes’
09-20-2005 | Permanent Link | No Comments | Related Entries: PHP 5.x, PHP 4.x, Information
Today being it is our 16th wedding anniversary I decided it would be appropriate to build a small script to keep track and post a message automatically on our special day together. I wanted this program to remember what year of our anniversary it was without me having to remind it: a great use for […]
09-19-2005 | Permanent Link | No Comments | Related Entries: PHP 5.x, PHP 4.x, Information