sitepoint



SitePoint » PHP


How to Roll Your Own JavaScript Compressor with PHP and the Closure Compiler
In my previous post, I discussed the Closure Compiler’s REST API . In this article, we’ll develop a small PHP program that shows how the API can be used to compress JavaScript code whenever you need it.
[Why write your own system? ]
You’ll find that several free tools handle this task; one of the first PHP JavaScript compressors was written by Ed Eliot ...

-- Tue, 31 Aug 2010 07:21:25 +0000


Is Your PHP Application Affected by the Y2K38 Bug?
I don’t want to be too alarmist, but try running the following PHP code on your system: [What’s the Y2K38 bug?] ...

-- Tue, 24 Aug 2010 10:02:14 +0000


How to Upload Large Files in PHP
Uploading a file from a web form in PHP is easy. The online manual provides a Handling File Uploads section, and there are several articles on sitepoint.com, including How To Handle File Uploads With PHP by Kevin Yank. One of the most popular uses is image uploads. Your users can submit photographs from a form without resorting to FTP or other convoluted ...

-- Tue, 17 Aug 2010 07:35:20 +0000


Redirecting Old URLs in WordPress
We recently devised a system to redirect old URLs in PHP so that you could avoid “page not found” errors (I suggest you read it before venturing further). In this article, we’ll create a similar system for WordPress, the popular PHP CMS .
[How is WordPress different?]
WordPress routes all requests through a single index.php file. Under normal circumstances, all URLs that don’t ...

-- Tue, 10 Aug 2010 07:09:12 +0000


How to Avoid 404s and Redirect Old URLs in PHP
Nothing can be said to be certain, except death and taxes. And URL changes. It’s often necessary to reorganize your site and change the URL structure but, assuming you have similar content, users should rarely encounter a “page not found” error. Producing unnecessary 404 pages is one of my top 10 development mistakes . In this article, we’ll create an automated PHP redirection system ...

-- Tue, 03 Aug 2010 11:44:51 +0000


Which Version of PHP Do You Use?
An interesting question was raised by dvduval in the SitePoint forums recently: Should we stop coding for PHP4? In a perfect world, the answer is an emphatic ‘yes’ and this was the response most people gave. Few will question that PHP5 offers a more robust object model, requires less code, is more secure and has better performance. ...

-- Wed, 09 Jun 2010 10:51:44 +0000


PHP is Fifteen Today!
PHP was released by Rasmus Lerdorf on June 8, 1995. His original usenet post is still available online if you want to examine a computing artefact from the dawn of the web. Many of us owe our careers to the language, so here’s a brief history of PHP… PHP originally stood for “Personal Home Page” and Rasmus started the project in 1994. PHP was written in C and was intended ...

-- Tue, 08 Jun 2010 18:33:29 +0000


PHP with nginx is about to Become a Lot Easier
PHP version 5.4 will most likely include the PHP-FPM patch right in the core, which is great news for those of us who like to run PHP under the nginx web server. You may be asking, “What is PHP-FPM, and why should I care?” PHP-FPM is a patch for PHP core that handles the starting, stopping, and restarting of FastCGI processes as needed. This is important because nginx can only interface with PHP via FastCGI, unlike Apache, ...

-- Tue, 04 May 2010 05:58:06 +0000


How to Make WordPress Easier for Clients, Part 2: Hiding Menus

In part 1 of this series , we discovered how easy it is to simplify the WordPress interface for clients. In this article, I describe a technique for hiding unnecessary menus. Why would we want to do that? The fewer options your client has, the less you’ll need to explain, the less they’ll need to remember, and the less likely they’ll do something, er … ...

-- Wed, 28 Apr 2010 16:19:47 +0000


How to Make WordPress Easier for Clients, Part 1: Custom Branding

WordPress is one of the web’s most popular Content Management Systems. The appeal is obvious: it’s flexible, it’s easy to create custom templates, it offers a huge quantity of plugins, hundreds of themes are available, the application is open source and it’s free. It’s also relatively simple for clients to understand — that’s one of the main reasons I use it. I recently posted the article Do Your Clients Use Their ...

-- Thu, 15 Apr 2010 06:12:52 +0000