Unique file names for uploaded files using PHP
August 28, 2008
Web page file uploads are very useful - custom front ends, absolute simplicity for end users, control over file types uploaded. But you'll need to guard against overwriting existing files when a file with the same name is submitted.
This four-line! PHP scriptlet creates a new file name from the original, appending an underscore and new, unique, sequentially incrementing number as required.
I also step through the code, bit by little bit - a neat little introduction to Regular Expression matching, if you're interested.
August 25, 2008
Rollovers are images that change appearance when the mouse moves over them: slick and functional cues that this, indeed, is an active link, and it'll take you somewhere.
Finally, we present a very few lines of code - easy to modify, and we tell you how. It works, in all the browsers we've tested it on. See it in action.
[ Read more ... ]
A free, simple, tunable grayscale function for dynamic image conversion using PHP and the gd library
February 17, 2008
Looking for a simple, tunable grayscale function, one you - or your web site's visitors - can use to dynamically generate grayscale images? Look no further. The following images were all generated from the first, using PHP with the gd graphics library, and Ars Informatica's AI_grayscale() function:
And it's as easy as
... or easier. [ Read more ... ]