PHP and MySQL
New: Visit my "PHP Musings" blog for more on the topic of PHP, MySQL, and related (and maybe unrelated) subjects.
PHP is a general-purpose, multi-platform scripting language optimized for use with web applications. MySQL is a multi-platform relational database management system. PHP includes many functions specifically for working hand-in-hand with MySQL; and as both are open-source programs, they are very popular for use in creating interactive web applications. As such, they have become my tools of choice for web programming.
Latest News from PHP.net
PHP 5.3.10 Released! (2012-02-02)
The PHP development team would like to announce the immediate availability of PHP 5.3.10. This release delivers a critical security fix.Security Fixes in PHP 5.3.10:Fixed arbitrary remote code execution vulnerability reported by Stefan Esser, CVE-2012-0830.All users are strongly encouraged to upgrade to PHP 5.3.10.For source downloads please visit our downloads page, Windows binaries can be found on windows.php.net/download/. (more...)
PHP 5.4.0 RC6 released (2012-01-24)
The PHP development team announces the 6th release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. THIS IS A RELEASE CANDIDATE - DO NOT USE IT IN PRODUCTION!. This is the 6th release candidate. The release candidate phase is intended as a period of bug fixing prior to the stable release. No new features should be included before the final version of PHP 5.4.0. The 6th release candidate focused on improving traits. Please test them carefully and help us to identify bugs in order to ensure that the release is solid and all things behave as expected. Please take the time to test this release candidate against your code base and report any problems that you encounter to the QA mailing list and/or the PHP bug tracker. A complete list of changes since the last release candidate can be found at NEWS The next candidate will be released on Feb 2. (more...)
PHP 5.3.9 Released! (2012-01-10)
The PHP development team would like to announce the immediate availability of PHP 5.3.9. This release focuses on improving the stability of the PHP 5.3.x branch with over 90 bug fixes, some of which are security related.Security Enhancements and Fixes in PHP 5.3.9:Added max_input_vars directive to prevent attacks based on hash collisions. (CVE-2011-4885)Fixed bug #60150 (Integer overflow during the parsing of invalid exif header). (CVE-2011-4566)Key enhancements in PHP 5.3.9 include:Fixed bug #55475 (is_a() triggers autoloader, new optional 3rd argument to is_a and is_subclass_of).Fixed bug #55609 (mysqlnd cannot be built shared)Many changes to the FPM SAPI moduleFor a full list of changes in PHP 5.3.9, see the ChangeLog. For source downloads please visit our downloads page, Windows binaries can be found on windows.php.net/download/.All users are strongly encouraged to upgrade to PHP 5.3.9. (more...)
Articles and Scripts
The following are a few articles/scripts I've cobbled together at one point or another regarding common issues in the use of these tools:
- (Updated 2008/05/12) The code I use for my Email Me page.
- Image rotation script: uses an AJAX implementation of JavaScript and PHP to rotate through a series of images with a time delay
- Anagram Finder: a little proof-of-concept script you might find fun or interesting
- PHP5 class for parsing ini files into a data array or object.
- JavaScript-based Background and text color-picker, using PHP to create the color palettes.
- Hack for a Problem with IE Displaying HTML Content via the OBJECT Tag
- Time Difference: a function to express the difference between two date/time values in terms of years, months, weeks, days, hours, minutes, and seconds
- Lorem Ipsum text generator
- PHP Dice Rolling Program
- Login Control with PHP
- Defensive Driving with PHP
- PHP class for MySQL interface
Links
Here are a few links to on-line references and sources which I frequently use:
- PHP Manual (see the Documentation page for other languages)
- MySQL 5.0 Refernece Manual
- PHP Forum at WebDeveloper.com
- Articles and tutorials at Zend.com
Forcing a File Download
This is just a little tip I picked up at the PHPBuilder.com forum to ensure that a file is presented for downloading rather than being automatically opened by a browser.
<?php
header('Content-Length: '.$fileSize);
header('Content-Type: '.$mimeType);
header('Content-Disposition: attachment; filename="'.$fileName.'"');
header('Content-Transfer-Encoding: binary');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');