<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>Matt Varone» Matt Varone » Creative Developer</title>
	
	<link>http://www.mattvarone.com</link>
	<description>Creative Developer</description>
	<lastBuildDate>Sun, 01 Nov 2009 12:16:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
<link>http://www.mattvarone.com</link>
<url>http://www.mattvarone.com/wp-content/mbp-favicon/favicon.ico</url>
<title>Matt Varone</title>
</image>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/feed/mattvarone" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>WordPress: Output Clean and Valid HTML Content</title>
		<link>http://www.mattvarone.com/wordpress/output-clean-valid-xhtml/</link>
		<comments>http://www.mattvarone.com/wordpress/output-clean-valid-xhtml/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 12:39:47 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[ACCESSIBILTY]]></category>
		<category><![CDATA[HTML and XHTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[RESOURCES]]></category>
		<category><![CDATA[TEMPLATE FUNCTIONS]]></category>

		<guid isPermaLink="false">http://www.mattvarone.com/?p=770</guid>
		<description><![CDATA[&#8212; I found that more than often clients generate a lot of garbage html in the post content with things like divs, p , a, etc. tags which haven&#8217;t been closed or opened properly. This makes the website fail to validate against W3C standards which in between other things, could potentially affect the site&#8217;s ranking [...]]]></description>
			<content:encoded><![CDATA[<p>&mdash; I found that more than often clients generate a lot of garbage html in the post content with things like <em>divs</em>, <em>p</em> , <em>a</em>, etc. tags which haven&#8217;t been closed or opened properly. This makes the website fail to validate against W3C standards which in between other things, could potentially affect the site&#8217;s ranking and its accessibility. Of course asking clients to switch to the HTML view to clean the content is out of the question, so a solution is needed, and been that this could happen to any site makes it something that we should take in count upfront when building a professional website.  </p>
<div class="post-box"><small>→ Clean The Content Function: <a href="http://lab.mattvarone.com/demos/clean/mattvarone-cleanwpcontent.zip">↓ Download</a> </small></div>
<p><span id="more-770"></span></p>
<p>After some research on the subject I found <strong><a href="http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/index.php">htmLawed</a></strong>, a PHP code to purify and filter HTML that works incredibly well. Props to the htmLawed team for their awesome work!. To merge it with WordPress I wrote a little function which automatically filters the content coming from the post. The results are amazing, htmLawed cleans and filters all the bad content and makes the pages validate again right away!</p>
<pre class="brush: php">
	include_once ( TEMPLATEPATH . &#039;/htmLawed.php&#039; ); // THIS FILE SHOULD RESIDE IN THE THEME FOLDER.

	function clean_the_content( $content )
	{
		$szPostContent = $content;
		$szRemoveFilter = array( &quot;~&lt;p[^&gt;]*&gt;\s?&lt;/p&gt;~&quot;, &quot;~&lt;a[^&gt;]*&gt;\s?&lt;/a&gt;~&quot;, &quot;~&lt;font[^&gt;]*&gt;~&quot;, &quot;~&lt;\/font&gt;~&quot;, &quot;~&lt;span[^&gt;]*&gt;\s?&lt;/span&gt;~&quot; );
		$szPostContent = preg_replace( $szRemoveFilter, &#039;&#039; , $szPostContent);
		$szPostContent = htmLawed($szPostContent);
		return $szPostContent;
	}

	add_filter(&#039;the_content&#039;, &#039;clean_the_content&#039;);
</pre>
<p>To use this function simple drop the two files in your theme directory and you are set to go!. Hope you find this post useful. Cheers!</p>

	<h4 class="related">Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.mattvarone.com/wordpress/list-recent-posts-in-wordpress/" title="List recent posts in WordPress (September 15, 2008)">List recent posts in WordPress</a> (3)</li>
	<li><a href="http://www.mattvarone.com/wordpress/list-users/" title="Custom Query: List WordPress Users (November 19, 2008)">Custom Query: List WordPress Users</a> (63)</li>
	<li><a href="http://www.mattvarone.com/wordpress/useful-functions-for-wordpress/" title="Useful custom functions for WordPress (November 11, 2008)">Useful custom functions for WordPress</a> (61)</li>
	<li><a href="http://www.mattvarone.com/wordpress/functionsphp-wordpress-themes/" title="Taking Advantage of Functions.php in Wordpress Themes (October 23, 2008)">Taking Advantage of Functions.php in Wordpress Themes</a> (39)</li>
	<li><a href="http://www.mattvarone.com/wordpress/scrnshotsrss-plugin-update-2/" title="ScrnshotsRSS plugin 2.0 update (November 10, 2008)">ScrnshotsRSS plugin 2.0 update</a> (2)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.mattvarone.com/wordpress/output-clean-valid-xhtml/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>UItoTop jQuery Plugin</title>
		<link>http://www.mattvarone.com/web-design/uitotop-jquery-plugin/</link>
		<comments>http://www.mattvarone.com/web-design/uitotop-jquery-plugin/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 14:11:56 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[INTERFACE DESIGN]]></category>
		<category><![CDATA[JQUERY]]></category>
		<category><![CDATA[PLUGINS]]></category>
		<category><![CDATA[RESOURCES]]></category>

		<guid isPermaLink="false">http://www.mattvarone.com/?p=763</guid>
		<description><![CDATA[
&#8212; Inspired by the great idea of David Walsh&#8217;s  jQuery topLink Plugin, I made a similar plugin but with two key differences, this one does not require you to add extra html markup or extra plugins to function. It will only work when JavaScript is turned on ( on purpose ), It&#8217;s easy to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.mattvarone.com/wp-content/uploads/2009/09/uitotop.jpg" alt="uitotop" title="uitotop" width="577" height="134" class="border aligncenter size-full wp-image-765" /></p>
<p>&mdash; Inspired by the great idea of David Walsh&#8217;s <a href="http://davidwalsh.name/jquery-top-link/"> jQuery topLink Plugin</a>, I made a similar plugin but with two key differences, this one does not require you to add extra html markup or extra plugins to function. It will only work when JavaScript is turned on ( on purpose ), It&#8217;s easy to setup with only one line of code, and it works cross-browser nicely ( Tested: IE6-8, FF, Safari ). Optionally it can benefit from the <a href="http://gsgd.co.uk/sandbox/jquery/easing/">jQuery Easing plugin</a> with a different easing animation for the page scrolling.</p>
<div class="post-box"><small>→ UItoTop: <a href="http://lab.mattvarone.com/projects/jquery/totop/">View the demo</a> | <a href="http://lab.mattvarone.com/projects/jquery/totop/UItoTop.zip">↓ Download</a> </small></div>

	<h4 class="related">Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.mattvarone.com/wordpress/scrnshots-plugin-for-wordpress/" title="ScrnshotsRSS: Scrnshots.com Plugin For Wordpress (October 8, 2008)">ScrnshotsRSS: Scrnshots.com Plugin For Wordpress</a> (25)</li>
	<li><a href="http://www.mattvarone.com/wordpress/scrnshotsrss-plugin-update-2/" title="ScrnshotsRSS plugin 2.0 update (November 10, 2008)">ScrnshotsRSS plugin 2.0 update</a> (2)</li>
	<li><a href="http://www.mattvarone.com/wordpress/wordpress-plugins-i-use/" title="Lovely WordPress Plugins I use (August 2, 2008)">Lovely WordPress Plugins I use</a> (4)</li>
	<li><a href="http://www.mattvarone.com/icon/free-mini-calendar-icons-set/" title="Free Mini Calendar Icons Set (September 20, 2008)">Free Mini Calendar Icons Set</a> (8)</li>
	<li><a href="http://www.mattvarone.com/icon/free-daily-calendar-icons-set-for-css/" title="Free Daily Calendar Icons Set For CSS (September 22, 2008)">Free Daily Calendar Icons Set For CSS</a> (17)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.mattvarone.com/web-design/uitotop-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SimpleForm: Easy PHP multi-form email handler</title>
		<link>http://www.mattvarone.com/web-design/simpleform-php-email-script/</link>
		<comments>http://www.mattvarone.com/web-design/simpleform-php-email-script/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 18:49:46 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[FORMS]]></category>
		<category><![CDATA[MAIL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.mattvarone.com/?p=705</guid>
		<description><![CDATA[— It&#8217;s been a while, but today I am releasing a new version of my contact form script, this time under the name SimpleForm. It&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>— It&#8217;s been a while, but today I am releasing a new version of my <a href="http://www.mattvarone.com/web-design/php-contact-form-script/" title="contact form script" >contact form script</a>, this time under the name <strong>SimpleForm</strong>. It&#8217;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 <strong>easy solution to handle one or many forms with little effort</strong>. It&#8217;s mainly focused on ease of use and rapid deployment.</p>
<p><img src="http://www.mattvarone.com/wp-content/uploads/2009/04/simpleform.jpg" alt="simpleform" title="simpleform" width="577" height="134" class="aligncenter border" /></p>
<p class="message-box info"> Current version: <strong>1.1.4</strong> <small>7/31/09</small>  </p>
<h4>These are a couple of it&#8217;s main features <strong>( ver. 1.1.4 )</strong>:</h4>
<p>* Multiform handler.<br />
* Support for required fields.<br />
* PHP <a href="http://www.linuxjournal.com/article/9585" title="email validation" >email validation</a>.<br />
* Unobtrusive JavaScript function to pre-check form data ( 4KB file ).<br />
* Lightweight, easy to use.<br />
* Multilingual support.<br />
* External configuration file that can reside outside the public folder.</p>
<div class="post-box"><small>→ SimpleForm: <a href="http://lab.mattvarone.com/demos/simpleform/">View the demo</a> | <a href="http://lab.mattvarone.com/demos/simpleform/multiple.php" title="Mutiple Forms">Mutiple Forms</a> | <a href="http://lab.mattvarone.com/demos/simpleform/simpleform.1.1.4.zip">↓ Download</a> </small></div>
<h3>HOW DOES IT WORKS?</h3>
<p>It&#8217;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&#8217;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.</p>
<h3>INSTALLING THE SCRIPT</h3>
<h4>These are the necessary steps to have it up and running ( requires PHP 5 ):</h4>
<ol  class="normal">
<li><strong>Download</strong> <a href="http://lab.mattvarone.com/demos/simpleform/simpleform.1.1.4.zip">SimpleForm</a> ( ver 1.1.4 )</li>
<li><strong>Open sf-config.php</strong> and edit the necessary info.</li>
<li><strong>Upload sf-config.php</strong> to your host ( preferably outside the public folder ).</li>
<li>Open <strong>simpleform.php</strong> and edit the variable <em>$PATH_TO_CONFIG_FILE</em> ( on line 24 ) with the path from <em>simpleform.php</em> to <em>sf-config.php</em> ( leave empty if it resides on the same folder ).</li>
<li>Upload<strong> simpleform.php</strong>, <strong>simpleform.css</strong> and <strong>checkform.mini.js</strong> inside your public folder.</li>
<li>Open your form page/s and <strong>add the necessary code snippets</strong>.</li>
</ol>
<p><span id="more-705"></span></p>
<h3>EDITING THE CONFIGURATION FILE SF-CONFIG.PHP</h3>
<pre class="brush: php">
# ------------------------------------------------------------ #
// SIMPLEFORM CONFIGURATION								      //
# ------------------------------------------------------------ #

/* GENERAL CONFIGURATION
/////////////////////////////*/

// The name of the website/client. Example: &quot;My Website&quot;.
$aSettings[&quot;szFrom&quot;] = &quot;&quot;;							

// The email address that will receive the emails. Example: &quot;me@myemail.com&quot;.
$aSettings[&quot;szRecipient&quot;] = &quot;&quot;;		

/* The email address that will be used to send the emails. To work properly this has to be a real account
configured on the same server of the site. Example: &quot;noreply@mywebsite.com&quot;. */
$aSettings[&quot;szFromEmail&quot;] = &quot;&quot;;					    

/* FORMS CONFIGURATION
/////////////////////////////*/

/* The next step is to configure the Form/s.
   You can add as many as you want. */

$aForms = array(

	1 =&gt; array( 									// FORM ID: 1
		&quot;szFormTitle&quot; =&gt; &quot;&quot;,						// FORM TITLE - Example: &quot;Contact Form&quot;
		&quot;szFormURL&quot; =&gt; &quot;&quot;,							// FORM URL ( users will be redirected to this page )
		&quot;szFormRequired&quot; =&gt; array(					/* REQUIRED FIELDS ( array of name attributes ) */
			&quot;name&quot;,
			&quot;email&quot;,
		),
		&quot;aFormFields&quot; =&gt; array( 					/* LIST OF FORM FIELDS AND THEIR OUTPUT NAME
 													  All input fields coming from the form should go here.
													  The first value is the name attribute used and the second value
													  on the right the name displayed on the outputed data.

													  Any required field that contains the word &quot;email&quot; will have
													  it&quot;s value validated as an email address. */
		   	&quot;name&quot; =&gt; &quot;First Name&quot;,
			&quot;email&quot; =&gt; &quot;E-mail&quot;,
			&quot;work_email&quot; =&gt; &quot;Work Email&quot;,
			&quot;phone&quot; =&gt; &quot;Telephone&quot;,
			&quot;-sep1&quot; =&gt; &quot;This is a separator&quot;,		/* This is a separator. Any variable starting with the sign &quot;-&quot;
														will act as a content separator. */
			&quot;color&quot; =&gt; &quot;Color Option&quot;,
			&quot;comments&quot; =&gt; &quot;Comments&quot;,
			&quot;-sep2&quot; =&gt; &quot;This is Another separator&quot;,
			&quot;newsletter&quot; =&gt; &quot;Subscribe to our Newsletter?&quot;,
			&quot;interested[]&quot; =&gt; &quot;Im interested in&quot;,
			/* add more */
			)
	),

	2 =&gt; array(										/* Form 2. Same as above */
		&quot;szFormTitle&quot; =&gt; &quot;&quot;,
		&quot;szFormRequired&quot; =&gt; array(),
		&quot;szFormURL&quot; =&gt; &quot;&quot;,
		&quot;aFormFields&quot; =&gt; array(
			/* add more */
			)
	),

	3 =&gt; array(										/* Form 3. Same as above */
		&quot;szFormTitle&quot; =&gt; &quot;&quot;,
		&quot;szFormRequired&quot; =&gt; array(),
		&quot;szFormURL&quot; =&gt; &quot;&quot;,
		&quot;aFormFields&quot; =&gt; array(
			/* add more */
			)
		),

	/* add more */
);

/* RESPONSE CONFIGURATION
/////////////////////////////*/

/* Response Messages: These are the variables that hold the messages
the system prints as response. You can modify them to suit your project needs. */

 // Form has been sent.
$aSettings[&quot;aMessages&quot;][&quot;szSubmitSucess&quot;]  = &quot;Your message has been sent succesfully. Thanks!&quot;;
// Missing fields.
$aSettings[&quot;aMessages&quot;][&quot;szMissingFields&quot;] = &quot;Please complete all required fields.&quot;;
// Unvalid email address.
$aSettings[&quot;aMessages&quot;][&quot;szUnvalidEmail&quot;]  = &quot;Please insert a valid email address.&quot;;
// Email not sent by system error.
$aSettings[&quot;aMessages&quot;][&quot;szSystemError&quot;]   = &quot;There was an error in the system. Please try again later. Thanks!&quot;;

/* ADVANCED CONFIGURATION
/////////////////////////////*/

// Name of the GET variable to pass response messages
define( &quot;GET_NAME&quot;, &quot;response&quot;);
// Debug mode ( prints email content, and system errors )
define( &quot;DEBUG_MODE&quot; , false );
/* Check if the domain of the submited email addresses exists.
False by default as it may bring problems with some servers. ) */
define( &quot;CHECK_EMAIL_ADDRESS_DNS&quot; , false );
</pre>
<h3>INTEGRATING SIMPLEFORM WITH YOUR FORMS</h3>
<p>Below you&#8217;ll find the things you need to do to your form page ( must be php file ) for SimpleForm to work. I also have included a full example at bottom.</p>
<h4>A. Add  Javascript and CSS files</h4>
<p>	Add <strong>simpleform.css</strong> and<strong> checkform.js</strong> ( or <strong>checkform.mini.js</strong> ) inside the <strong>&lt;head&gt;</strong> element:</p>
<pre class="brush: html">
	&lt;link rel=&quot;stylesheet&quot; href=&quot;simpleform.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot;/&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;checkform.mini.js&quot;&gt;&lt;/script&gt;
	</pre>
<h4>B. Define the path to the config file and Include <strong>simpleform.php</strong> in the document ( before your form/s ):</h4>
<pre class="brush: php">
	&lt;?php
	define( &quot;CONFIG_PATH&quot;, &quot;place/here/the/path/to/sf-congif/dir/&quot; );
	require_once &quot;simpleform.php&quot;;
	$sForm = new simpleForm();
	?&gt;
	</pre>
<h4>C. Add SimpleForm <strong>Responses function</strong></h4>
<p>		   Prints the systems response and can reside anywhere on the document.</p>
<pre class="brush: php">
			&lt;?php
 		   	// Example: &lt;p class=&quot;message-box error&quot;&gt;Please insert a valid email address.&lt;/p&gt;
 		   	$sForm-&gt;handleMessage(); ?
 		   	&gt;
		</pre>
<p>Output example:
<p class="message-box error">Please insert a valid email address.</p>
<h4>D. Add SimpleForm <strong>Form function</strong></h4>
<p> This function generates the required hidden input fields for simpleForm to work. The value passed is the ID assigned to the current form in the configuration file. This function must reside in between the &lt;form&gt;&lt;/form&gt;  elements.</p>
<pre class="brush: php">
 &lt;?php
 //Prints necessary data for the form with the ID = 1
$sForm-&gt;printData(1);
?&gt;
</pre>
<h4>E. Edit the<strong> &lt;form&gt; attributes</strong>:</h4>
<p>	Point the form&#8217;s <em>action attribute</em> to <strong>simpleform.php</strong> and then add the <strong>checkform</strong> function to enable the js data pre-checking.</p>
<pre class="brush: html">

	&lt;form action=&quot;simpleform.php&quot; method=&quot;post&quot; onsubmit=&quot;return checkform(this)&quot;&gt;
</pre>
<p>	The <strong>checkform()</strong> function supports an optional string parameter which alters the text you<br />
want to display on the js alerts. The variable #name is provided as a wildcard for the field Name.</p>
<p>	<strong>Examples:</strong><br />
				&#8220;Please complete the field #name&#8221;<br />
				&#8220;The field #name is missing&#8221;<br />
				&#8220;Por Favor complete el campo #name&#8221;</p>
<pre class="brush: html">
				onsubmit=&quot;return checkform(this,&#039;The field #name is missing&#039;)&quot;
				</pre>
<h4>Full Example</h4>
<pre class="brush: php">
	&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
		&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
		&lt;head&gt;
			&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
			&lt;title&gt;SimpleForm Example&lt;/title&gt;
			&lt;link rel=&quot;stylesheet&quot; href=&quot;simpleform.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot;/&gt;
			&lt;script type=&quot;text/javascript&quot; src=&quot;checkform.mini.js&quot;&gt;&lt;/script&gt;
		&lt;/head&gt;
		&lt;body&gt;

			&lt;?php
			define( &quot;CONFIG_PATH&quot;, &quot;../secure/&quot; );

			require_once &quot;simpleform.php&quot;;
			$sForm = new simpleForm();

			$sForm-&gt;handleMessage();
			?&gt;

			&lt;form action=&quot;simpleform.php&quot; method=&quot;post&quot; onsubmit=&quot;return checkform(this)&quot;&gt;
		 	&lt;fieldset&gt;
		 	&lt;?php $sForm-&gt;printData(1); ?&gt;
				&lt;legend&gt;Personal Details:&lt;/legend&gt;
		        &lt;label for=&quot;name&quot; &gt;Name&lt;/label&gt;
		        &lt;input name=&quot;name&quot; id=&quot;name&quot; type=&quot;text&quot; value=&quot;&quot; /&gt;
		        &lt;label for=&quot;email&quot;&gt;Email &lt;span class=&quot;required&quot;&gt;(required)&lt;/span&gt;&lt;/label&gt;
		        &lt;input name=&quot;email&quot; id=&quot;email&quot; type=&quot;text&quot; value=&quot;&quot; /&gt;
				&lt;label for=&quot;work_email&quot;&gt;Work Email&lt;/label&gt;
		        &lt;input name=&quot;work_email&quot; id=&quot;work_email&quot; type=&quot;text&quot; value=&quot;&quot; /&gt;
				&lt;label for=&quot;phone&quot;&gt;Telephone &lt;span class=&quot;required&quot;&gt;(required)&lt;/span&gt;&lt;/label&gt;
		        &lt;input name=&quot;phone&quot; id=&quot;phone&quot; type=&quot;text&quot; value=&quot;&quot; /&gt;
		        &lt;label for=&quot;color&quot;&gt;Color Options: &lt;span class=&quot;required&quot;&gt;(required)&lt;/span&gt;&lt;/label&gt;
		        &lt;select name=&quot;color&quot; id=&quot;color&quot;&gt;
					&lt;option value=&quot;-&quot;&gt;Choose a color&lt;/option&gt;
					&lt;option value=&quot;Red&quot;&gt;Red&lt;/option&gt;
					&lt;option value=&quot;Green&quot;&gt;Green&lt;/option&gt;
					&lt;option value=&quot;Blue&quot;&gt;Blue&lt;/option&gt;
				&lt;/select&gt;
		        &lt;label for=&quot;comments&quot;&gt;Comments&lt;/label&gt;
		        &lt;textarea name=&quot;comments&quot; id=&quot;comments&quot; rows=&quot;10&quot; cols=&quot;50&quot;&gt;&lt;/textarea&gt;
		        &lt;/fieldset&gt;
		        &lt;fieldset class=&quot;radio&quot;&gt;
		            &lt;legend&gt;Subscribe to our Newsletter? &lt;span class=&quot;required&quot;&gt;(required)&lt;/span&gt;&lt;/legend&gt;
		            &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;newsletter&quot; value=&quot;Yes&quot; /&gt; Yes&lt;/label&gt;
		            &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;newsletter&quot; value=&quot;No&quot; /&gt; No&lt;/label&gt;
		        &lt;/fieldset&gt;
				&lt;fieldset class=&quot;checkbox&quot;&gt;
		            &lt;legend&gt;Im interested in: &lt;span class=&quot;required&quot;&gt;(required)&lt;/span&gt;&lt;/legend&gt;
		            &lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;interested[]&quot; value=&quot;Arts&quot; /&gt; Arts&lt;/label&gt;
					&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;interested[]&quot; value=&quot;Science&quot; /&gt; Science&lt;/label&gt;
					&lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;interested[]&quot; value=&quot;Sports&quot; /&gt; Sports&lt;/label&gt;
		        &lt;/fieldset&gt;

		        &lt;p&gt;&lt;button type=&quot;submit&quot;&gt;Submit this!&lt;/button&gt;&lt;/p&gt;
		    &lt;/form&gt;

		&lt;/body&gt;
		&lt;/html&gt;
</pre>
<div class="post-box"><small>→ SimpleForm: <a href="http://lab.mattvarone.com/demos/simpleform/">View the demo</a> | <a href="http://lab.mattvarone.com/demos/simpleform/multiple.php" title="Mutiple Forms">Mutiple Forms</a> | <a href="http://lab.mattvarone.com/demos/simpleform/simpleform.1.1.2.zip">↓ Download</a> </small></div>
<h3>RELEASE NOTES</h3>
<p><strong>ver 1.1.4</strong> &#8211; Another Email Bug fixed ( Courtesy of megabonez ).<br />
<strong>ver 1.1.3</strong> &#8211; Email Bug fixed ( Mayor thanks to Jim from <a href="http://www.cpscreative.com">cpscreative.com</a> ).<br />
<strong>ver 1.1.2</strong> &#8211; Minor Bugs fixed.<br />
<strong>ver 1.1.1</strong> &#8211; Optional Email DNS checking.<br />
<strong>ver 1.1</strong> &#8211; Easier path deployment, Configurable response variable name, Debug function and minor bug fixes.<br />
<strong>ver 1.0</strong> &#8211; First Release.</p>

	<h4 class="related">Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.mattvarone.com/web-design/php-contact-form-script/" title="PHP Contact form script (September 16, 2008)">PHP Contact form script</a> (4)</li>
	<li><a href="http://www.mattvarone.com/wordpress/output-clean-valid-xhtml/" title="WordPress: Output Clean and Valid HTML Content (October 30, 2009)">WordPress: Output Clean and Valid HTML Content</a> (10)</li>
	<li><a href="http://www.mattvarone.com/web-design/ternary-conditionals-in-php/" title="Ternary Conditionals in PHP (October 25, 2008)">Ternary Conditionals in PHP</a> (5)</li>
	<li><a href="http://www.mattvarone.com/wordpress/scrnshotsrss-plugin-update-2/" title="ScrnshotsRSS plugin 2.0 update (November 10, 2008)">ScrnshotsRSS plugin 2.0 update</a> (2)</li>
	<li><a href="http://www.mattvarone.com/wordpress/images-post-wordpress-regular-expressions/" title="Manipulate images from WordPress post&#8217;s content with Regular Expressions (October 7, 2008)">Manipulate images from WordPress post&#8217;s content with Regular Expressions</a> (24)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.mattvarone.com/web-design/simpleform-php-email-script/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
		<item>
		<title>Custom WordPress function to check page parent</title>
		<link>http://www.mattvarone.com/wordpress/wordpress-check-page-parent/</link>
		<comments>http://www.mattvarone.com/wordpress/wordpress-check-page-parent/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 21:39:14 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[TEMPLATE FUNCTIONS]]></category>

		<guid isPermaLink="false">http://www.mattvarone.com/?p=694</guid>
		<description><![CDATA[&#8212; Quick update to the is_subpage() function. Basically it&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>&mdash; Quick update to the <a href="http://www.mattvarone.com/wordpress/is_subpage-function/">is_subpage() function</a>. Basically it&#8217;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 <strong>true</strong> value otherwise, it will be <strong>false</strong>.</p>
<div class="post-box"><small>→  Download <a href="http://lab.mattvarone.com/demos/wp-functions/functions-part4.zip">the function here</a></small></div>
<pre class="brush: php">
function is_subpage( $iID = null )
	{
		global $post, $wpdb;

		if ( is_page() AND isset( $post-&gt;post_parent ) != 0 )
		{
			$aParent = $wpdb-&gt;get_row( $wpdb-&gt;prepare( &quot;SELECT ID FROM $wpdb-&gt;posts WHERE ID = %d AND post_type = &#039;page&#039; LIMIT 1&quot;, $post-&gt;post_parent ) );

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

		}
		else
		{
			return false;
		}
	}

/* EXAMPLE */

if ( is_page(&#039;producs&#039;) OR is_subpage( 8 ) )
{
  //do something
};
</pre>
<p>Cheers!</p>

	<h4 class="related">Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.mattvarone.com/wordpress/output-clean-valid-xhtml/" title="WordPress: Output Clean and Valid HTML Content (October 30, 2009)">WordPress: Output Clean and Valid HTML Content</a> (10)</li>
	<li><a href="http://www.mattvarone.com/wordpress/list-recent-posts-in-wordpress/" title="List recent posts in WordPress (September 15, 2008)">List recent posts in WordPress</a> (3)</li>
	<li><a href="http://www.mattvarone.com/wordpress/list-users/" title="Custom Query: List WordPress Users (November 19, 2008)">Custom Query: List WordPress Users</a> (63)</li>
	<li><a href="http://www.mattvarone.com/wordpress/add-css-javascript-wordpress-theme/" title="Correct way of adding CSS and Javascript references to WordPress themes (October 5, 2008)">Correct way of adding CSS and Javascript references to WordPress themes</a> (10)</li>
	<li><a href="http://www.mattvarone.com/wordpress/useful-functions-for-wordpress/" title="Useful custom functions for WordPress (November 11, 2008)">Useful custom functions for WordPress</a> (61)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.mattvarone.com/wordpress/wordpress-check-page-parent/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Clean Accessible Form Foundation</title>
		<link>http://www.mattvarone.com/web-design/clean-accesible-form-foundation/</link>
		<comments>http://www.mattvarone.com/web-design/clean-accesible-form-foundation/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 20:15:35 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[FORMS]]></category>
		<category><![CDATA[HTML and XHTML]]></category>

		<guid isPermaLink="false">http://www.mattvarone.com/?p=215</guid>
		<description><![CDATA[— 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 [...]]]></description>
			<content:encoded><![CDATA[<p>— 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.</p>
<div class="post-box"><small>→ Final product: <a href="http://lab.mattvarone.com/demos/clean-accessible-form/index.html">view the demo</a> | <a href="http://lab.mattvarone.com/demos/clean-accessible-form/demo-clean-form-mattvarone.com.zip">↓ Download</a> </small></div>
<h3>GOALS:</h3>
<p>There were a couple of things I had in mind when creating this form, first of all the code would have to be <strong>valid XHTML</strong>, clean semantic and well formated. This would need to have a good balance between <strong>accessibility and flexibility</strong> to make it <strong>portable</strong> and easy to style. This way you have more chances to easily copy and modify to adjust to different needs.<br />
<span id="more-215"></span></p>
<h3>The Markup:</h3>
<p>Beyond the input elements XHTML gives us a set of tags to build our forms in an accessible way. I like to use <em>Fieldsets</em>, <em>Legends</em> and <em>Labels</em>. To display nicely aligned radio and checkbox buttons I use classes in the fieldsets: <em>.checkbox</em> and <em>.radio</em>. To style the overall form correctly I use the class <em>.cleanform</em>.</p>
<pre class="brush: xhtml">
&lt;form class=&quot;cleanform&quot; action=&quot;#&quot;&gt;
	&lt;fieldset&gt;
        &lt;legend&gt;Personal Details:&lt;/legend&gt;
        &lt;label for=&quot;name&quot; &gt;Name &lt;span class=&quot;required&quot;&gt;(required)&lt;/span&gt;&lt;/label&gt;
        &lt;input name=&quot;name&quot; id=&quot;name&quot; type=&quot;text&quot; value=&quot;Example text.&quot; /&gt;
        &lt;label for=&quot;email&quot;&gt;Email &lt;span class=&quot;required&quot;&gt;(required)&lt;/span&gt;&lt;/label&gt;
        &lt;input name=&quot;email&quot; id=&quot;email&quot; type=&quot;text&quot; value=&quot;Example text.&quot; /&gt;
        &lt;label for=&quot;inquiry&quot;&gt;Inquiry&lt;/label&gt;
        &lt;select name=&quot;inquiry&quot; id=&quot;inquiry&quot;&gt;
            &lt;option value=&quot;comment&quot;&gt;Comment&lt;/option&gt;
            &lt;option value=&quot;suggestion&quot;&gt;Suggestion&lt;/option&gt;
            &lt;option value=&quot;feedback&quot;&gt;Feedback&lt;/option&gt;
        &lt;/select&gt;
        &lt;label for=&quot;comments&quot;&gt;Comments&lt;/label&gt;
        &lt;textarea name=&quot;comments&quot; id=&quot;comments&quot; rows=&quot;10&quot; cols=&quot;50&quot;&gt;Example text.&lt;/textarea&gt;
    &lt;/fieldset&gt;
    &lt;fieldset class=&quot;radio&quot;&gt;
        &lt;legend&gt;Subscribe to my Newsletter? &lt;span class=&quot;required&quot;&gt;(required)&lt;/span&gt;&lt;/legend&gt;
        &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;newsletter&quot; value=&quot;Yes&quot; /&gt; Yes&lt;/label&gt;
        &lt;label&gt;&lt;input type=&quot;radio&quot; name=&quot;newsletter&quot; value=&quot;No&quot; /&gt; No&lt;/label&gt;
    &lt;/fieldset&gt;
	&lt;fieldset class=&quot;checkbox&quot;&gt;
        &lt;legend&gt;Aditional information&lt;/legend&gt;
        &lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;foo&quot; value=&quot;Foo yes&quot; /&gt; Foo&lt;/label&gt;
        &lt;label&gt;&lt;input type=&quot;checkbox&quot; name=&quot;bar&quot; value=&quot;Bar yes&quot; /&gt; Bar&lt;/label&gt;
    &lt;/fieldset&gt;
    &lt;p&gt;&lt;button type=&quot;submit&quot;&gt;Submit Form&lt;/button&gt;&lt;/p&gt;
&lt;/form&gt;
</pre>
<p>As you may see its a very simple and clean markup, I group related form elements in fieldsets and make use of the legend and label elements. </p>
<p>I also have the required labels. A common practice for this is to add an asterisk in red, I am not against that but I prefer to use the word &#8220;required&#8221; when possible. To achieve this I use the <em>span</em> element with a class named <em>.required</em>.</p>
<p>Optionally I add a little intro to make the form more intuitive:</p>
<pre class="brush: xhtml">
&lt;div class=&quot;formInfo&quot;&gt;
    &lt;h2&gt;Contact me Form&lt;/h2&gt;
    &lt;p&gt;Please complete the following form to reach me. Thank you!&lt;/p&gt;
&lt;/div&gt;
</pre>
<h3>The CSS</h3>
<p>CSS code for the <em>cleanform</em> class and its elements:</p>
<pre class="brush: css">
/* CLEAN FORM
/////////////////////////////*/

/* General */

.cleanform {
	font-size:1em;
	width:40em;
	color:#1b1b1b;
	text-align:left;
	margin:1em auto
}

/* Elements */

.cleanform  label,.cleanform legend{
	padding:0;
	margin:0.3em 0
}

.cleanform fieldset{
	padding:0.7em;
	border:1px solid #ddd;
	margin:0 0 0.5em 0
}

.cleanform label {
    font-weight:bold
}

.cleanform fieldset input {
    width:70%;
    line-height:1.5em;
	padding:0.15em
}

.cleanform .radio input,
.cleanform .checkbox input {
    width:auto;
    border:none;
    margin:0 1.5em 0 0
 }

.cleanform input, .cleanform textarea, .cleanform select {
    display:block;
    margin-bottom:1em;
    font-size:1em;
    border:1px solid #bbb;
    padding:0.15em;
    margin-right:1em
 }

.cleanform .radio label, .cleanform .radio input,
.cleanform .checkbox label, .cleanform .checkbox input {
    display:inline;
    margin:0 1.5em 0 0
}

.cleanform .radio input, .cleanform .checkbox input {
    margin:0 0.3em 0 0
}

/* Button */

.cleanform button {
	margin:0.3em 0;
	border:1px solid #ccc;
	background-color:#eee;
	font-size:1em;
	cursor:pointer;
	padding:0.5em
}

.cleanform button:hover {
	background-color:#e6efc2;
	border:1px solid #c6d880;
	color:#529214
}

.cleanform button:active {
	background-color:#333;
	color:white;
	border:1px solid #000
}

/* information */

.cleanform .formInfo {
    margin-bottom:1em;
    padding-bottom:0.5em;
    border-bottom:0.1em solid #ddd
}

.cleanform .formInfo h2 {
	color:#00889e;
	font-weight:bold;
	font-size:1.2em;
	margin-bottom:1em
}

.cleanform .formInfo p{
	text-align:justify
}

.cleanform .required {
	color:#ff3838;
	font-weight:bold;
	font-size:0.8em
}
</pre>
<p>With the styles above you have a clean, accessible and valid foundation from where you can style the form accordingly to your project needs. </p>
<div class="post-box"><small>→ Final product: <a href="http://lab.mattvarone.com/demos/clean-accessible-form/index.html">view the demo</a> | <a href="http://lab.mattvarone.com/demos/clean-accessible-form/demo-clean-form-mattvarone.com.zip">↓ Download</a> </small></div>
<h3>Conclusion</h3>
<p>I hope you found it useful and of course I suggest you to always choose the method/solution that you feel most comfortable with. Critics and comments are welcomed,<br />
Cheers!</p>
<p><small><em>This method has been tested in: IE6, IE7, Firefox 3 ( Mac &amp; PC ), Google Chrome, Opera ( Win )  and Safari 3.1 ( Mac ).</em></small></p>

	<h4 class="related">Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.mattvarone.com/web-design/css-navigation-generator/" title="From the lab: CSS Navigation Bar Code Generator (December 16, 2008)">From the lab: CSS Navigation Bar Code Generator</a> (9)</li>
	<li><a href="http://www.mattvarone.com/web-design/daily-calendar-dates-with-css/" title="Daily Calendar Dates With CSS (September 23, 2008)">Daily Calendar Dates With CSS</a> (6)</li>
	<li><a href="http://www.mattvarone.com/web-design/css-text-based-navigation-bar-with-images/" title="CSS Text based navigation bar with images (June 27, 2008)">CSS Text based navigation bar with images</a> (35)</li>
	<li><a href="http://www.mattvarone.com/wordpress/output-clean-valid-xhtml/" title="WordPress: Output Clean and Valid HTML Content (October 30, 2009)">WordPress: Output Clean and Valid HTML Content</a> (10)</li>
	<li><a href="http://www.mattvarone.com/web-design/simpleform-php-email-script/" title="SimpleForm: Easy PHP multi-form email handler (April 16, 2009)">SimpleForm: Easy PHP multi-form email handler</a> (48)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.mattvarone.com/web-design/clean-accesible-form-foundation/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>From the lab: CSS Navigation Bar Code Generator</title>
		<link>http://www.mattvarone.com/web-design/css-navigation-generator/</link>
		<comments>http://www.mattvarone.com/web-design/css-navigation-generator/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 18:18:23 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML and XHTML]]></category>
		<category><![CDATA[LAYOUT]]></category>
		<category><![CDATA[NAVIGATION BARS]]></category>

		<guid isPermaLink="false">http://www.mattvarone.com/?p=636</guid>
		<description><![CDATA[
— This web tool will help you generate the code you need to build a navigation bar with the technique described in this article: CSS Text based navigation bar with images.
The result is a valid and accessible text based imaged navigation bar with one sprite image, XHTML and CSS. I have included a short video [...]]]></description>
			<content:encoded><![CDATA[<p><a title="CSS Navigation Bar Code Generator" href="http://lab.mattvarone.com/navbar/"><img class="border2 aligncenter size-full" title="CSS Navigation Bar Code Generator" src="http://www.mattvarone.com/wp-content/uploads/2008/12/cssnavbar.jpg" alt="CSS Navigation Bar Code Generator" width="610" height="320" /></a></p>
<p>— This web tool will help you generate the code you need to build a navigation bar with the technique described in this article: <a href="http://www.mattvarone.com/web-design/css-text-based-navigation-bar-with-images/">CSS Text based navigation bar with images</a>.</p>
<p>The result is a valid and accessible text based imaged navigation bar with one sprite image, XHTML and CSS. I have included a <a href="http://lab.mattvarone.com/navbar/video.html">short video</a> as well to showcase the process.</p>
<div class="post-box"><small>→ <a href="http://lab.mattvarone.com/navbar/">CSS Navigation Bar Code Generator</a></small></div>
<p>Please let me know if you have any comment. You can download the generated code in a zip file.</p>
<p>Hope you find it useful. Enjoy!</p>

	<h4 class="related">Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.mattvarone.com/web-design/css-text-based-navigation-bar-with-images/" title="CSS Text based navigation bar with images (June 27, 2008)">CSS Text based navigation bar with images</a> (35)</li>
	<li><a href="http://www.mattvarone.com/web-design/daily-calendar-dates-with-css/" title="Daily Calendar Dates With CSS (September 23, 2008)">Daily Calendar Dates With CSS</a> (6)</li>
	<li><a href="http://www.mattvarone.com/web-design/clean-accesible-form-foundation/" title="Clean Accessible Form Foundation (January 8, 2009)">Clean Accessible Form Foundation</a> (33)</li>
	<li><a href="http://www.mattvarone.com/wordpress/output-clean-valid-xhtml/" title="WordPress: Output Clean and Valid HTML Content (October 30, 2009)">WordPress: Output Clean and Valid HTML Content</a> (10)</li>
	<li><a href="http://www.mattvarone.com/web-design/message-box-with-css/" title="Message Boxes with CSS (July 25, 2008)">Message Boxes with CSS</a> (10)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.mattvarone.com/web-design/css-navigation-generator/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 70.545 seconds. --><!-- Cached page generated by WP-Super-Cache on 2009-11-10 10:53:45 -->
