 | News Feed |
Sections
Community Events
Don't see your event here? Let us know!
|
| feed this: |  |
Jonathan Snook's Blog: Creating a Contact Form in CakePHP 1.2
posted Friday July 25, 2008 @ 07:58:30
voice your opinion now!
BY CHRIS CORNUTT
In a new blog post today Jonathan Snook shows how to create a contact form for your CakePHP application (version 1.2).
Most contact forms take a name and feedback from a user and mail it off to the administrator but don't store any information in the database. This tutorial will show how to use CakePHP's models, even when no table is being used.
He shows how to define the model class, set up the mapping of columns to named elements and the code to handle the submit. It just sends a basic email with the contents of the form with a few validation rules to ensure it's not abused. Simple stuff...
tagged with: contact form cakephp framework simple beginner tutorial
Robert Eisele's Blog: Face detection with PHP
posted Thursday July 24, 2008 @ 12:55:41
voice your opinion now!
BY CHRIS CORNUTT
Robert Eisele has posted on an interesting topic recently - using a PHP interface to the OpenCV library (from Intel) to detect faces in images.
The headline does say facedetection - but what does this mean? Easy said, this article focus on how to find faces on images with PHP. Faces have a certain form and so it is possible to search for it. At the end of the search you will say how many human faces are on the image or better: Where are human faces on my image. This article is not intended to be mathematically.
The OpenCV library is a pattern-detection tool that can, based on the "experience" it has trained on with sample files, do its best to find similar structures in any given image. He's come up with a wrapper that handles most of the details for you. You can define the xml file type (frontalface, lowerbody, upperbody, etc) that you want it to try to match to.
He gives some examples of the output from each on one of the sample images included in the training group as well as a random photo grab from flickr that dynamically tries to apply one of the face filters.
tagged with: face detect opencv intel wrapper tutorial
SitePoint PHP Blog: Mangling XML as Text with PHP DOM
posted Thursday July 24, 2008 @ 09:35:16
voice your opinion now!
BY CHRIS CORNUTT
In trying to convert over several HTML pages to the DITA XML format, James Edwards came up against a problem involving recursion:
But a problem I came across several times was the sheer complexity of recursive element conversion â€" <code> becomes <jsvalue> (or one of a dozen similar elements), <a> becomes <xref> … and that's all simple enough; but each of these elements might contain the other, or further child elements like <em>, and as we walk through the DOM so the incidence of potential recursion increases, until it gets to the point where my brain explodes.
His solution involves working with both regular expressions and document fragments. He loads the node he wants to work with, its parsed to prepare it and is passed off to do the "text-based mangling" to update it. The result is them pushed back into an XML object (fragment) and this is pushed back into the main document with a replaceChild call.
tagged with: dom xml convert dita replacechild fragment node tutorial
DevShed: A Better Way to Determine MIME Types for MIME Email with PHP
posted Thursday July 24, 2008 @ 07:53:18
voice your opinion now!
BY CHRIS CORNUTT
Continuing on in their look at sending MIME emails with PHP, DevShed has posted a better way for you to determine the correct MIME type of the file you're wanting to send (third part of the series).
I demonstrated how to build a modular MIME mailer class in PHP 4; it was provided with the capacity to send messages in plain text, and to work with different types of file attachments. This class implements a private method, called "getMimeTypes()," which, as its name would suggest, comes in handy for determining the correct MIME type of a given file. [...] However, the logic implemented by this method is rather primitive and can definitely be improved.
They start with a review of the previous code (PHP4) and show how to get the correct mime type of the file based on the extension mapped to an array of types.
tagged with: mime tutorial type mail php4 class getmimetypes extension
Jonathan Snook's Blog: Multiple Validation Sets in CakePHP 1.2
posted Wednesday July 23, 2008 @ 07:51:27
voice your opinion now!
BY CHRIS CORNUTT
Jonathan Snook has posted two methods for creating multiple validation sets in the latest version of your CakePHP application.
In CakePHP, you define how your data should be validated by setting parameters on the validate property of your model. In version 1.2, there is an on option that can be set on a specific rule that, when set, is either create or update. [...] Despite that, I developed a slightly different approach that allows for different validation sets to be specified and to be cleanly separated from each other.
He overrides the validates() method with his own in a custom model in one of two ways - having the script check for a validation set for the current controller or by specifying it directly with a validationSet property. Code for both methods is included.
tagged with: cakephp framework validation set detect controller property define tutorial
NETTUTS.com: Can You Hack Your Own Site? A Look at Some Essential Security Considerations
posted Tuesday July 22, 2008 @ 12:57:07
voice your opinion now!
BY CHRIS CORNUTT
On the NETTUTS.com website, there's a great article with some "essential security considerations" that you can use to see just how hackable your site could be.
This article walks through the brainstorming stage of planning for what is in this instance, a hypothetical user-centric web application. Although you won’t be left with a complete project â€" nor a market ready framework, my hope is that each of you, when faced with future workloads, may muse on the better practices described. So, without further ado...Are you sitting comfortably?
The tutorial is broken up into a few sections based around an example with a few points of failure (about book information). They work through the thought process behind the code, using the $_REQUEST variables correctly, preventing SQL injections, filtering the HTML output and a sample code download for you to see how it's all tied together.
tagged with: security consideration hack tutorial sqlinjection filter output input
Zend Developer Zone: Generating PDF Forms From a Flex Application With PHP
posted Monday July 21, 2008 @ 15:15:49
voice your opinion now!
BY CHRIS CORNUTT
The Zend Developer Zone has posted a new tutorial today (from Richard Bates) about creating PDF forms from inside a Flex application with a little help from PHP.
Leveraging the power of PHP and a PDF generation library called dompdf, you can create a simple, seamless user experience in Adobe Flex. Flex enables you to create an outstanding presentation to the end-user, with instant validation of user-supplied data and the full power of ActionScript 3. Through AMFPHP, you'll gain access to PHP's full toolset, enabling virtually limitless applications.
They show how to install the needed packages - AMFPHP and the dompdf PHP package to make the PDF generation easy ("one of the best PDF tools for PHP you can get"). The rest is the creation of the Flex part of the application - generating the form and using PHP to push out a PDF file at the other end, complete with their data.
tagged with: flex application amfphp pdf form tutorial richardbates
Developer Tutorials Blog: Debugging PHP with Firebug and FirePHP
posted Monday July 21, 2008 @ 12:58:26
voice your opinion now!
BY CHRIS CORNUTT
The Developer Tutorials blog has a new post covering a very helpful tool when it comes to debugging your sever-side scripts with something light and client-side (but powerful) - the FirePHP project combined with Firebug.
FirePHP is a plugin for Firebug, the web development plugin for Firefox, that allows PHP scripts to talk to a Firebug panel. FirePHP installs alongside Firebug, and provides a simple PHP library to bridge the two. FirePHP provides a window of insight into your PHP applications, with a simple debugging interface that won't interfere with your page content. If you already use Firebug on PHP-powered applications, FirePHP is definitely worth a look.
The FirePHP library installs onto your server and is included, via PHP, into your application. Passing errors back is as simple as using the fb() method to send information out to the Firebug instance waiting on your browser.
tagged with: firebug firephp debug tutorial example
|