Unique file names for uploaded files using PHPAugust 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.
How-to Rollover Images - CSS, Flash, and JavascriptAugust 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.
Rollover images can be coded in CSS, Flash, or Javascript. Which should you use? We present the pros and cons for each method, then tell you why we think you should use Javascript. (Hint: the CSS method causes artifacting in Internet Explorer, and Flash is frequently not supported.)
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 libraryFebruary 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
AI_grayscale($image, 0.8);
... or easier. [ Read more ... ]
|