 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
NETTUTS.com: Image Resizing Made Easy with PHP
by Chris Cornutt March 19, 2010 @ 08:47:48
New from NETTUTS.com there's a recent tutorial showing you how to use the GD graphics library (bundled with PHP) to resize images on the fly.
Ever wanted an all purpose, easy to use method of resizing your images in PHP? Well that's what PHP classes are for '" reusable pieces of functionality that we call to do the dirty work behind the scenes. We're going to learn how to create our own class that will be well constructed, as well as expandable. Resizing should be easy.
The simple eleven-step process (don't worry, it sounds worse than it is) has you go from a basic image and, with the help of a custom PHP class, create a resized image based on a type such as "landscape", "auto" or "exact". Full code is included for you to cut and paste or you can download the source and have the full code ready and waiting.
voice your opinion now!
image resize tutorial gd graphic library
PHPBuilder.com: Create a CAPTCHA Script with PHP
by Chris Cornutt January 06, 2010 @ 11:49:52
On PHPBuilder.com today there's a new tutorial posted helping you create a simple CAPTCHA image you can use in your forms to help to somewhat secure them from scripts out there that might abuse them.
CAPTCHA protection is used on web site forms and works by generating a random string, writing it to an image, then storing the string inside of a session. Then, the site checks the CAPTCHA when the form is submitted. In this article, you will learn how to make your own simple CAPTCHA image using PHP. You will create the CAPTCHA image step by step.
Their example uses numbers, lowercase letters and a few other characters to create the distorted image. The tutorial shows you how to take this character set, pull out a few randomized values and push them into a dynamically created image with PHP's built-in GD functionality. They also include a brief script showing how to use it in the form for validation of the submission.
voice your opinion now!
captcha tutorial gd image
Maurice Svay's Blog: Face detection in pure PHP (without OpenCV)
by Chris Cornutt June 22, 2009 @ 12:53:22
Maurice Svay has a new blog post that includes a script he's developed to perform facial recognition (detect faces in images) with PHP without the need of the Open-CV library.
OpenCV seems to perform well but you need to be able to install it on your server. In my case, I wanted to have a pure PHP solution, so it can work with most hosts. So I started to think about implementing it myself. [...] I kept searching and finally found a canvas+javascript implementation of face detection at http://blog.kpicturebooth.com/?p=8. The code looked fairly compact and simple. Shouldn't be hard to port to PHP.
The class takes in the filename of an image (just JPG, but could easily be adapted) and a data file to use to run the image through the GD image library and output a JPG similar to this with the face highlighted by a red square.
voice your opinion now!
gd opencv detection face
DevShed: Designing a Captcha System with PHP and MySQL
by Chris Cornutt June 05, 2009 @ 08:49:15
On DevShed's PHP section today there's a new tutorial focusing on the creation of a CAPTCHA image to help prevent spam on the forms (and other input methods) of your website.
Spam is one of the biggest problems on the Internet. It is getting harder to fight with the advent of spam bots that visit websites and automatically fetch email addresses, fill out forms and do other nasty things, such as blog spam comments, that could degrade your integrity. Fortunately, using captcha can help. This article will show you how to implement captcha on your site.
CAPTCHA images are those small images, usually at the bottom of forms, that have distorted letters and numbers in an effort to prevent anything not human from submitting the form correctly. They're usually accompanied by a form field asking for the letters/numbers displayed in the image. In the tutorial they use PHP's built in GD support to create a script that builds the image from an inputted string.
They also give an option for a GD-less version, but it's not nearly as dynamic and wouldn't help as much as the image generated on the fly.
voice your opinion now!
tutorial gd mysql captcha
WebReference.com: User Personalization with PHP The Verification Code
by Chris Cornutt March 17, 2009 @ 09:37:50
WebReference.com continues their look at user personalization with the second part of the series - how to validate that the users signing up for your site are valid. (Here's part one, the introduction).
In this article, we will be looking at user authentication. User authentication simply means verifying that a particular user has the right to access a part of our application. Because our application deals with user preferences, access control is even more pertinent especially since multiple users are going to try to access this application at any given time.
As a part of this user validation and customization, they need to create a form that non-human scripts have a harder time using (hopefully weeding them out and getting better user information). The article steps you through a few lines of code that you can use to create a simple image of a four-digit number whose value is placed in a session variable so it can be validated on submission of the form.
voice your opinion now!
captcha image validation user personalization gd random digit
PHPFreaks.com: PHP Add Text To Image
by Chris Cornutt January 26, 2009 @ 12:04:06
This new tutorial from the PHPFreaks.com website shows how to add text into a custom created image (they go with an Arial font in a PNG image).
One of the standard features of a message board is allowing members to have a signature, which is appended to the bottom of each post they make. Posters can put whatever they want into the signature (within forum settings). Putting quotes in one's signature is one of the more popular things to do. [...] Soon afterwards, I started receiving messages on a fairly regular basis asking me "What kind of sorcery is this?? How do I do that??" You know, I think it's kind of funny people should ask, because this is really nothing new.
His code (the full script is here) sets up the font size, the font face (Arial) and the quotes to be randomly pulled from first. The image manipulation comes next - making a PNG resource, adding a few colors and shapes, and dropping in the text.
Each line of the code is covered in detail so you'll understand exactly what's going on. The end result is a script that makes a simple image and can be easily expanded to work with other sources (like databases or flat text files).
voice your opinion now!
tutorial image dynamic gd text signature forum random
Vinu Thomas' Blog: pChart - PHP charting library
by Chris Cornutt October 22, 2008 @ 07:53:00
Vinu Thomas points out a nice looking PHP charting library on his blog today - pChart.
Looking for some good looking graphs without having to pay for a library or resort to Flash graphs? Try creating your own using pChart. pChart is a PHP class oriented framework designed to create aliased charts. This project focuses on allowing developers to generate great looking graphs by increasing rendering quality introducing an aliasing algorithm.
It uses GD to create the graphs, so just about any PHP distribution out there will support it (if you're not sure, make a phpinfo() page to check out your setup). There's even some example graphs so you can get an idea of what some of the end results could be.
voice your opinion now!
pchart chart library gd graphics image render
International Stock Exchange Forum: Getting RSS Feeds into Lively
by Chris Cornutt July 10, 2008 @ 15:28:09
Just for you Lively early adopters out there, there's a script that's been posted to the International Stock Exchange forum showing how to get a feed into the virtual world.
Here is a free PHP script to convert the titles of a news feed to a PNG graphic for display in Google Lively. To display a news feed in Google Lively, go to the "Add object" button, search for "Picture Frame". Click on add to room and then edit properties. In Gadget Options place the url of the PHP script in the option box.
The script can then be hosted on a web server where it can pull down the latest stories and update the PNG image accordingly.
voice your opinion now!
rss feed lively google object widget picture frame gd
|
Community Events
Don't see your event here? Let us know!
|