SimpleForm: Easy PHP multi-form email handler

— It’s been a while, but today I am releasing a new version of my contact form script, this time under the name SimpleForm. It’s a nicer version of the previous one, re-written from the ground up and with a couple of new features. SimpleForm is basically meant to be an easy solution to handle one or many forms with little effort. It’s mainly focused on ease of use and rapid deployment.

simpleform

Current version: 1.1.2 4/20/09

These are a couple of it’s main features ( ver. 1.1.2 ):

* Multiform handler.
* Support for required fields.
* PHP email validation.
* Unobtrusive JavaScript function to pre-check form data ( 4KB file ).
* Lightweight, easy to use.
* Multilingual support.
* External configuration file that can reside outside the public folder.

→ SimpleForm: View the demo | Mutiple Forms | ↓ Download

HOW DOES IT WORKS?

It’s very simple, first there is a configuration file where you define all of your website forms, by this I mean form title, form fields, form required fields and the location of each form. Then there are some snippets you have to add to your form page/s and thats all. SimpleForm takes care of pre-cheking the form fields with JS and then validating them with PHP, if it’s valid then it will send the email to the configured email address and return the user to the form page with a success message or otherwise, with an error message.

INSTALLING THE SCRIPT

These are the necessary steps to have it up and running ( requires PHP 5 ):

  1. Download SimpleForm ( ver 1.1.2 )
  2. Open sf-config.php and edit the necessary info.
  3. Upload sf-config.php to your host ( preferably outside the public folder ).
  4. Open simpleform.php and edit the variable $PATH_TO_CONFIG_FILE ( on line 24 ) with the path from simpleform.php to sf-config.php ( leave empty if it resides on the same folder ).
  5. Upload simpleform.php, simpleform.css and checkform.mini.js inside your public folder.
  6. Open your form page/s and add the necessary code snippets.

› Continue reading

Tags: , ,

Thursday, April 16th, 2009 Web Design 36 Comments

Custom WordPress function to check page parent

— Quick update to the is_subpage() function. Basically it’s does the same but now it also accepts an integer to check if the current page is a child of certain ID. This way its easier to track if the current location is a subpage of a certain page. If it matches it will return a true value otherwise, it will be false.

→ Download the function here
function is_subpage( $iID = null )
	{
		global $post, $wpdb;

		if ( is_page() AND isset( $post->post_parent ) != 0 )
		{
			$aParent = $wpdb->get_row( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE ID = %d AND post_type = 'page' LIMIT 1", $post->post_parent ) );

			if ( is_int( $iID ) > 0 )
				if ( $aParent->ID == $iID ) return true; else return false;
			else
				if ( $aParent->ID )	return true; else return false;

		}
		else
		{
			return false;
		}
	}

/* EXAMPLE */

if ( is_page('producs') OR is_subpage( 8 ) )
{
  //do something
};

Cheers!

Tags: ,

Sunday, April 12th, 2009 WordPress 4 Comments

Clean Accessible Form Foundation

— As soon as you drop tables you find that making nicely formated and accessible forms is not that simple. There are many discussed methods to achieve this and there will always be something to argue about them. Having said that I present you here with a solution that in most of the cases works for me. I hope you find this useful.

→ Final product: view the demo | ↓ Download

GOALS:

There were a couple of things I had in mind when creating this form, first of all the code would have to be valid XHTML, clean semantic and well formated. This would need to have a good balance between accessibility and flexibility to make it portable and easy to style. This way you have more chances to easily copy and modify to adjust to different needs.
› Continue reading

Tags: , ,

Thursday, January 8th, 2009 Web Design 32 Comments
« Previous Entries

About Me

Matt Varone - Matias Varone - sksmatt
HI there,

I'm a freelance creative web developer, UI designer and WordPress lover.

Twitter Status

Flickr Gallery

    Clutter drawerCS4 Replacement iconsCS4 Replacement iconsMagic

Scrnshots Gallery

  • Screenshot from ScrnShots.com
  • Screenshot from ScrnShots.com
  • new site im working on
  • Screenshot from ScrnShots.com