<?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>HTML form guide</title>
	
	<link>http://www.html-form-guide.com/blog</link>
	<description>How to make good web forms</description>
	<lastBuildDate>Mon, 23 Nov 2009 10:46:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/HtmlFormGuide" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="htmlformguide" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">HtmlFormGuide</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>A rich password widget for your web forms</title>
		<link>http://www.html-form-guide.com/blog/web-form-widget/54/web-form-password-widget/</link>
		<comments>http://www.html-form-guide.com/blog/web-form-widget/54/web-form-password-widget/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 17:34:56 +0000</pubDate>
		<dc:creator>prasanth</dc:creator>
				<category><![CDATA[form widgets]]></category>
		<category><![CDATA[form password]]></category>
		<category><![CDATA[web form]]></category>

		<guid isPermaLink="false">http://www.html-form-guide.com/blog/?p=54</guid>
		<description><![CDATA[ 
		digg_url = "http://www.html-form-guide.com/blog/web-form-widget/54/web-form-password-widget/";
	 
	Here is a password field widget that not only has a password strength meter but also has other essential features that your users would love to have.


Mask or unmask? Do passwords really have to look like **** ?
When you type-in your password, the password field shows a mask. This mask supposedly [...]]]></description>
			<content:encoded><![CDATA[<div id="socialize-in-content"><div class="socialize-in-button"><script type="text/javascript"> 
		digg_url = "http://www.html-form-guide.com/blog/web-form-widget/54/web-form-password-widget/";
	</script> 
	<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div></div><p>Here is a password field widget that not only has a password strength meter but also has other essential features that your users would love to have.</p>
<p><img src="http://www.html-form-guide.com/blog/wp-content/uploads/2009/10/password-widget-1.png" alt="password-widget-1" width="185" height="77" class="alignnone size-full wp-image-75" /></p>
<p><span id="more-54"></span></p>
<h2>Mask or unmask? Do passwords really have to look like **** ?</h2>
<p>When you type-in your password, the password field shows a mask. This mask supposedly prevents someone from observing your screen &#8216;over the shoulder&#8217; . </p>
<p>But, what if I am at home with the only possible observer being my pet dog? Why not leave the option of showing/masking the password to me, the user?</p>
<p><img src="http://www.html-form-guide.com/blog/wp-content/uploads/2009/10/password-widget-2.png" alt="form password show/hide" width="377" height="105" class="alignnone size-full wp-image-76" /></p>
<h2>Need a strong password quickly? Generate it.</h2>
<p>There are <a href='http://mashable.com/2008/11/05/password-management-for-firefox-3/'>many good password managers available</a>. For those users, it will just be good to generate a password for the web site and then let the password manager remember it for life. Having a password generator along with the password field will be handy. </p>
<h2>Strength meter.</h2>
<p>Another common feature is to have a strength meter that persuades the user to have a better password rather than their pet name. Based on some basic rules (have a number and a symbol in the password) a strength value is displayed that, hopefully, will make the user create a better password. </p>
<h2>See the widget in action !</h2>
<p><!-- Smart Youtube --><span class="youtube"><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/tU8IrwVvHNg&amp;rel=0&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;iv_load_policy=3&amp;showsearch=0" /><param name="allowFullScreen" value="true" /><embed wmode="transparent" src="http://www.youtube.com/v/tU8IrwVvHNg&amp;rel=0&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;iv_load_policy=3&amp;showsearch=0" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="355" ></embed><param name="wmode" value="transparent" /></object></span></p>
<h2>Try it yourself!</h2>
<p><a href="http://www.html-form-guide.com/demos/sample-reg-form.html">Password widget demo page</a></p>
<h2>Download</h2>
<p><a href="/downloads/PasswordWidget.zip">PasswordWidget.zip</a></p>
<p>The download contains the source and some samples.</p>
<h2>Usage</h2>
<p>The usage is simple.<br />
First, link to the style sheet and the JavaScript file:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;STYLESHEET&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;pwdwidget.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;pwdwidget.js&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Instead of the password field, use the code below.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label</span> <span style="color: #000066;">for</span>=<span style="color: #ff0000;">'regpwd'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Password:<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;br</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">'pwdwidgetdiv'</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">'thepwddiv'</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span>  <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
var pwdwidget = new PasswordWidget('thepwddiv','regpwd');
pwdwidget.MakePWDWidget();
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;noscript<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'password'</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">'regpwd'</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">'regpwd'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>    
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/noscript<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Notice that noscript part makes sure that a normal password field is shown even if Java Script is disabled. </p>
<p>The parameters to the PasswordWidget() class are: (1)the ID of the div for the widget and (2)the name of the password field.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> pwdwidget <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> PasswordWidget<span style="color: #009900;">&#40;</span>id_of_div<span style="color: #339933;">,</span>name_of_passwordfield<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>More options</h2>
<p>The features can be turned on/off. For example, it doesn&#8217;t make sense to have a &#8216;generate&#8217; option in a log-in form. Here is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> pwdwidget <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> PasswordWidget<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'thepwddiv'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'regpwd'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
pwdwidget.<span style="color: #660066;">enableGenerate</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
pwdwidget.<span style="color: #660066;">enableShowStrength</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
pwdwidget.<span style="color: #660066;">MakePWDWidget</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Similarly, you can modify/translate the label text :</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> pwdwidget <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> PasswordWidget<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'thepwddiv'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'regpwd'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
pwdwidget.<span style="color: #660066;">txtShow</span><span style="color: #339933;">=</span> <span style="color: #3366CC;">'Display'</span><span style="color: #339933;">;</span>
pwdwidget.<span style="color: #660066;">txtMask</span><span style="color: #339933;">=</span> <span style="color: #3366CC;">'Hide'</span><span style="color: #339933;">;</span>
pwdwidget.<span style="color: #660066;">MakePWDWidget</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h2>License</h2>
<p><a href="http://www.gnu.org/copyleft/lesser.html"><img border='0' alt="" src="http://www.gnu.org/graphics/lgplv3-147x51.png" class="alignnone" width="147" height="51" /></a><br />
The Password widget is shared under LGPL license. You can freely use it on commercial or non-commercial websites.</p>
<p>The password widget was tested on IE7, FireFox 3, Opera 9.24, and Safari 3.1.<br />
Post your comments and suggestions. Translations and enhancements are also welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.html-form-guide.com/blog/web-form-widget/54/web-form-password-widget/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Why is my PHP script not sending emails?</title>
		<link>http://www.html-form-guide.com/blog/php-form-email/3/php-script-not-sending-email/</link>
		<comments>http://www.html-form-guide.com/blog/php-form-email/3/php-script-not-sending-email/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 04:52:18 +0000</pubDate>
		<dc:creator>prasanth</dc:creator>
				<category><![CDATA[php form email]]></category>
		<category><![CDATA[email form]]></category>
		<category><![CDATA[php email script]]></category>

		<guid isPermaLink="false">http://www.html-form-guide.com/blog/?p=3</guid>
		<description><![CDATA[ 
		digg_url = "http://www.html-form-guide.com/blog/php-form-email/3/php-script-not-sending-email/";
	 
	It has happened too often to me to get stuck with a &#8216;form to email&#8217; script. Everything appears right but the email sent by the script never reaches the destination address.
This article takes you through the steps to troubleshoot the problem.

Email : background 
email is one of the earliest communication systems [...]]]></description>
			<content:encoded><![CDATA[<div id="socialize-in-content"><div class="socialize-in-button"><script type="text/javascript"> 
		digg_url = "http://www.html-form-guide.com/blog/php-form-email/3/php-script-not-sending-email/";
	</script> 
	<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div></div><p>It has happened too often to me to get stuck with a &#8216;form to email&#8217; script. Everything appears right but the email sent by the script never reaches the destination address.</p>
<p>This article takes you through the steps to troubleshoot the problem.<br />
<span id="more-3"></span></p>
<h2>Email : background </h2>
<p>email is one of the earliest communication systems evolved on the internet. Though email is still the most prevalent communication system on the internet, email spam has grown to be a huge problem.</p>
<p>About <strong>100 billion</strong> spam emails are being sent every single day (yeah, not a typo; 100 billion, every day!). Over 94% of all email sent is spam. Every email server gets a fair share of that 100 billion and has to cope with the bombardment of such a huge amount of spam. Therefore, email servers (MTA: Mail Transfer Agents)  have equipped themselves with methods to scrutinize the email messages and reject the email if it suspects the message to be spam.</p>
<p>This is the reason why your script should craft the email carefully to avoid the message being rejected.<br />
<img src="http://www.html-form-guide.com/blog/wp-content/uploads/2009/09/email-bombardment.png" alt="email-bombardment" width="394" height="277" class="alignnone size-full wp-image-36" /></p>
<h2>The &#8216;From&#8217; field and source address spoofing</h2>
<p>An email message has two parts: a header and the message itself. The header contains a few pieces of identifying information. The &#8216;From&#8217; field is one of the email header fields. The purpose of &#8216;From&#8217; field is to indicate who sent the email. However, the email sender can set the &#8216;From&#8217; field to be any address of his choice.<br />
Spammers exploit this aspect of the protocol. For example, a spammer can send an email making it appear like the email is coming from security@bank.com and ask the victim to give the bank log-in details. The spammer does not need access to the bank server to do this. Adding a &#8220;From: security@bank.com&#8221; header to the email will make the users think that the email is coming from the bank.<br />
For details see  <a href="http://en.wikipedia.org/wiki/E-mail_source_address_spoofing">email source address spoofing</a></p>
<h2>The cure: SPF</h2>
<p><a href="http://en.wikipedia.org/wiki/Sender_Policy_Framework">Sender Policy Framework (SPF)</a> was introduced to prevent email source address spoofing.<br />
Here is how it works:<br />
Let&#8217;s say a spammer is sending you a fake message.</p>
<ul>
<li>Your email server receives the message from the spammer.</li>
<li>The email server looks for the &#8216;From&#8217; address in the email header.<br />
Suppose &#8216;From&#8217; field is &#8217;security@bank.com&#8217;</li>
<li>Your email server requests for the DNS records of bank.com domain ( in simple terms, DNS is for resolving a domain name like bank.com to an IP address ). The DNS records of a domain can contain SPF records. The SPF records will indicate which IP addresses can send email on its behalf. Most of the time, it will only be the main mail server (example: bank.com in this case). Since the spammer&#8217;s IP address is different, the email gets rejected.</li>
</ul>
<p>Imagine you received a phone call and the caller claimed that he is calling from the bank. You can verify it by looking up the incoming call&#8217;s phone number in the telephone directory. The SPF system follows the same method.</p>
<h2>Setting the &#8216;From&#8217; field right</h2>
<p>Have a &#8216;From&#8217; field in the emails that you sent through the script. The From address should belong to the domain from where you are running the script. If your script is running on your-website.com then the From address should be like someone@your-website.com.</p>
<p>Sample PHP code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: someone@your-website.com&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span><span style="color: #000088;">$subj</span><span style="color: #339933;">,</span><span style="color: #000088;">$body</span><span style="color: #339933;">,</span><span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>What if you want to have some-other.com as the from address?<br />
You have update the SPF records of some-other.com to indicate that your-website.com can send emails on behalf of some-other.com. See: <a href="http://www.openspf.org">openspf.org</a> for details.</p>
<h2>Replying to the visitor who submitted a form</h2>
<p>When sending email from a &#8216;form to email&#8217; script, it will be convenient to have the website visitor&#8217;s email address in the &#8216;From&#8217; field. You can reply to the message by just pressing the &#8216;Reply&#8217; button in the email client. However, this can result in the email not reaching you.</p>
<p>For example, suppose this is the form to email code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$visitor_email</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: <span style="color: #006699; font-weight: bold;">$visitor_email</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span><span style="color: #000088;">$subj</span><span style="color: #339933;">,</span><span style="color: #000088;">$body</span><span style="color: #339933;">,</span><span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now, if someone submits their email address as &#8217;someone@a-company.com&#8217;, when the email server receives this email message, it checks whether your website can send emails on behalf of  a-company.com domain and ends up rejecting the email.</p>
<p>The right alternative is to use the &#8216;Reply-To&#8217; email header. Set the &#8216;From&#8217; to be an address belonging to your web site domain and add a &#8216;Reply-To&#8217; header with the web site visitor&#8217;s email address.</p>
<p>Example code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: name@your-website.com&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Reply-To: <span style="color: #006699; font-weight: bold;">$visitor_email</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span><span style="color: #000088;">$subj</span><span style="color: #339933;">,</span><span style="color: #000088;">$body</span><span style="color: #339933;">,</span><span style="color: #000088;">$headers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Keep in mind that you need to <a href="http://www.phpro.org/examples/Sanitize-email.html">sanitize</a> all the values used in the header attribute of the mail().</p>
<h2>Make sure the php.ini is configured right</h2>
<p>If you are still not receiving the emails, the problem could be in the PHP setup. The mail should be configured in the PHP configuration file php.ini.</p>
<p>The following code shows a typical PHP mail configuration (using sendmail)</p>
<pre>
[mail function]
; Setup for Linux systems
sendmail_path = /usr/sbin/sendmail -t
sendmail_from = me@myserver.com
</pre>
<p>The following code shows SMTP configuration in php.ini</p>
<pre>
[mail function]
; Setup for Windows systems
SMTP = smtp.my.isp.net
sendmail_from = me@myserver.com
</pre>
<p>Note that you can update the php.ini only if you are running your own web server. Instead, if you are hosting the website with a web hosting service, contact the service provider to setup php mail right.</p>
<h2>A simple script to test your PHP &#8211;&gt; mail configuration</h2>
<p><a href="http://www.html-form-guide.com/downloads/sample-emailer.zip">Download this php email script</a>. Edit the file and update the $from_add and $to_add variables. (see the instructions in the code). Upload the script to your web site. Access the page. You will see a submit button on the page. Press the submit button to send an email to yourself.<br />
If you are not getting the email still, get help from your hosting service provider/network admin. Point them to this sample script that fails to send email.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.html-form-guide.com/blog/php-form-email/3/php-script-not-sending-email/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
