<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Nancy Fusco &#187; how to</title>
	<atom:link href="http://nancyfusco.com/wp/index.php/tag/how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://nancyfusco.com/wp</link>
	<description></description>
	<lastBuildDate>Sun, 05 Feb 2012 14:47:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>How to add a button to jEdit for Infoviewer preview in browser</title>
		<link>http://nancyfusco.com/wp/index.php/2011/10/how-to-add-button-to-jedit-for-infoviewer-preview-in-browser/</link>
		<comments>http://nancyfusco.com/wp/index.php/2011/10/how-to-add-button-to-jedit-for-infoviewer-preview-in-browser/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 15:48:28 +0000</pubDate>
		<dc:creator>Nancy</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[add button]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[infoviewer]]></category>
		<category><![CDATA[jedit]]></category>
		<category><![CDATA[preview in browser]]></category>

		<guid isPermaLink="false">http://nancyfusco.com/wp/?p=1127</guid>
		<description><![CDATA[Now that you&#8217;ve got jEdit and Infoviewer working together to use Firefox to preview your web pages or code, it gets tedious quite quickly to go all the way thru the menu&#8217;s just to load a page. So, let&#8217;s setup a button on the toolbar in jEdit to launch our preview. Open jEdit and go [...]]]></description>
			<content:encoded><![CDATA[<p>Now that you&#8217;ve got<a title="How to launch firefox from jedit" href="http://nancyfusco.com/wp/index.php/2011/10/how-to-launch-firefox-preview-from-jedit/"> jEdit and Infoviewer working together to use Firefox to preview your web pages or code</a>, it gets tedious quite quickly to go all the way thru the menu&#8217;s just to load a page.</p>
<p>So, let&#8217;s setup a button on the toolbar in jEdit to launch our preview.</p>
<p>Open jEdit and go to Utilities | Global Options</p>
<p><img class="aligncenter size-full wp-image-1128" title="add-button-infoviewer-1" src="http://nancyfusco.com/wp/wp-content/uploads/2011/10/add-button-infoviewer-1.png" alt="" width="484" height="339" /></p>
<p>Select Toolbar from the left menu and then click the Add button at the bottom.</p>
<p><img class="aligncenter size-full wp-image-1130" title="add-button-infoviewer-3" src="http://nancyfusco.com/wp/wp-content/uploads/2011/10/add-button-infoviewer-3.png" alt="" width="576" height="86" /></p>
<p>You will now see all the options for this new button. Here is how I have mine setup:</p>
<div id="attachment_1129" class="wp-caption aligncenter" style="width: 632px"><a href="http://nancyfusco.com/wp/wp-content/uploads/2011/10/add-button-infoviewer-2.png" target="_blank"><img class="size-full wp-image-1129" title="add-button-infoviewer-2" src="http://nancyfusco.com/wp/wp-content/uploads/2011/10/add-button-infoviewer-2.png" alt="" width="622" height="442" /></a><p class="wp-caption-text">click for fullsize image</p></div>
<p>Now, when I click the &#8220;Internet&#8221; or Globe icon, my current page will load in Firefox directly from jEdit!</p>
<p><img class="aligncenter size-full wp-image-1131" title="add-button-infoviewer-4" src="http://nancyfusco.com/wp/wp-content/uploads/2011/10/add-button-infoviewer-4.png" alt="" width="544" height="256" /></p>
]]></content:encoded>
			<wfw:commentRss>http://nancyfusco.com/wp/index.php/2011/10/how-to-add-button-to-jedit-for-infoviewer-preview-in-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to launch Firefox preview from jEdit</title>
		<link>http://nancyfusco.com/wp/index.php/2011/10/how-to-launch-firefox-preview-from-jedit/</link>
		<comments>http://nancyfusco.com/wp/index.php/2011/10/how-to-launch-firefox-preview-from-jedit/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 14:57:37 +0000</pubDate>
		<dc:creator>Nancy</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[infoviewer]]></category>
		<category><![CDATA[jedit]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[set external browser]]></category>

		<guid isPermaLink="false">http://nancyfusco.com/wp/?p=1121</guid>
		<description><![CDATA[jEdit is my code editor of choice. I&#8217;m running it on Windows 7. Here&#8217;s some quick instructions for setting up the preview of your code or web pages to launch Firefox instead of  jEdit&#8217;s own internal browser. First, install the InfoViewer plugin from within jEdit. Open jEdit choose Plugins &#124; Plugin Options under InfoViewer &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>jEdit is my code editor of choice. I&#8217;m running it on Windows 7. Here&#8217;s some quick instructions for setting up the preview of your code or web pages to launch Firefox instead of  jEdit&#8217;s own internal browser.</p>
<p>First, install the InfoViewer plugin from within <a title="jEdit Text Editor" href="http://www.jedit.org/" target="_blank">jEdit</a>.</p>
<p>Open jEdit choose Plugins | Plugin Options under InfoViewer | Choose Browser check the box &#8220;Use internal&#8230;&#8221;, then tick the box &#8220;External Browser&#8221;  and set the path below:</p>
<p>c:\Program Files\Mozilla Firefox\firefox.exe $u</p>
<p>Apply it.</p>
<p>Now, when you want to load the current page/file into Firefox, choose Plugins | InfoViewer | Open current buffer with browser</p>
<p><img class="aligncenter size-full wp-image-1122" title="info-viewer-settings" src="http://nancyfusco.com/wp/wp-content/uploads/2011/10/info-viewer-settings.png" alt="Firefox as browser in jEdit Infoviewer" width="628" height="465" /></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://nancyfusco.com/wp/index.php/2011/10/how-to-launch-firefox-preview-from-jedit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quick White Balance Correction in Gimp</title>
		<link>http://nancyfusco.com/wp/index.php/2009/12/quick-white-balance-correction-in-gimp/</link>
		<comments>http://nancyfusco.com/wp/index.php/2009/12/quick-white-balance-correction-in-gimp/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 14:32:32 +0000</pubDate>
		<dc:creator>Nancy</dc:creator>
				<category><![CDATA[graphic design]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[white balance]]></category>

		<guid isPermaLink="false">http://nancyfusco.com/wp/?p=910</guid>
		<description><![CDATA[I notice that most of my winter, aka &#8220;snow&#8221;, pictures have this dull gray color to them. For quick white balance correction in Gimp, open the image. Now from the menu on the Image, choose COLOR &#124; AUTO &#124; WHITE BALANCE Gimp&#8217;s auto white balance has been pretty reliable to quickly set the correct tones [...]]]></description>
			<content:encoded><![CDATA[<p>I notice that most of my winter, aka &#8220;snow&#8221;, pictures have this dull gray color to them. For quick white balance correction in Gimp, open the image. Now from the menu on the Image, choose COLOR | AUTO | WHITE BALANCE</p>
<div id="attachment_911" class="wp-caption alignnone" style="width: 310px"><a href="http://nancyfusco.com/wp/wp-content/uploads/2009/12/before_auto_whitebalance.png"><img class="size-medium wp-image-911" title="before_auto_whitebalance" src="http://nancyfusco.com/wp/wp-content/uploads/2009/12/before_auto_whitebalance-300x186.png" alt="before_auto_whitebalance" width="300" height="186" /></a><p class="wp-caption-text">click image for a larger version</p></div>
<p>Gimp&#8217;s auto white balance has been pretty reliable to quickly set the correct tones in my grayish photos. See the results here:</p>
<div id="attachment_912" class="wp-caption alignnone" style="width: 310px"><a href="http://nancyfusco.com/wp/wp-content/uploads/2009/12/after_auto_whitebalance.png"><img class="size-medium wp-image-912" title="after_auto_whitebalance" src="http://nancyfusco.com/wp/wp-content/uploads/2009/12/after_auto_whitebalance-300x186.png" alt="click image for a larger version" width="300" height="186" /></a><p class="wp-caption-text">click image for a larger version</p></div>
<p>And there you go &#8211; one click white balance correction in Gimp!</p>
]]></content:encoded>
			<wfw:commentRss>http://nancyfusco.com/wp/index.php/2009/12/quick-white-balance-correction-in-gimp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Delete &#8220;undeletable&#8221; files from Linux Trash</title>
		<link>http://nancyfusco.com/wp/index.php/2009/11/how-to-delete-undeletable-files-from-linux-trash/</link>
		<comments>http://nancyfusco.com/wp/index.php/2009/11/how-to-delete-undeletable-files-from-linux-trash/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 00:32:42 +0000</pubDate>
		<dc:creator>Nancy</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[trash]]></category>

		<guid isPermaLink="false">http://nancyfusco.com/wp/?p=881</guid>
		<description><![CDATA[I&#8217;ve been cleaning up some junk files off my linux laptop and deleted files from various directories with no problem. Well, then I go to Empty the Trash Can when I get an error message &#8211; something about can&#8217;t delete those files due to permissions. Did some google searching and found this helpful tip from [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been cleaning up some junk files off my linux laptop and deleted files from various directories with no problem. Well, then I go to Empty the Trash Can when I get an error message &#8211; something about can&#8217;t delete those files due to permissions. Did some google searching and found <a href="http://www.ubuntugeek.com/empty-ubuntu-gnome-trash-from-the-command-line.html" target="_blank">this helpful tip from the Ubuntu Geek</a> website about mid-way down in a post by Lopo.</p>
<p>Basically, I just opened Terminal in Super User mode (found this in my menu system at Applications | System Tools | Terminal Program &#8211; Super User Mode). You will need to enter your root (super user aka su) password before proceeding.</p>
<p>Next, I entered this at the command line:</p>
<pre>sudo rm -rf /home/YOUR HOME DIRECTORY HERE/.local/share/Trash/files/*</pre>
<p>note: there is a space after the -rf and mind the capital letters as they matter to linux.</p>
<p><strong>**caution: this will really really really delete stuff so be careful**</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://nancyfusco.com/wp/index.php/2009/11/how-to-delete-undeletable-files-from-linux-trash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GIMP &#8211; Working with layers and autocrop layers</title>
		<link>http://nancyfusco.com/wp/index.php/2009/07/gimp-working-with-layers-and-autocrop-layers/</link>
		<comments>http://nancyfusco.com/wp/index.php/2009/07/gimp-working-with-layers-and-autocrop-layers/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 12:43:28 +0000</pubDate>
		<dc:creator>Nancy</dc:creator>
				<category><![CDATA[graphic design]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://nancyfusco.com/wp/?p=807</guid>
		<description><![CDATA[Once you start getting to work on a complex graphic, you&#8217;ll want to use layers. Here&#8217;s what I&#8217;ve found works best for me and seems to flow easily in GIMP. You can start with your own image, or download my classroom graphic here: classroom_small_zip. To view the Layer&#8217;s dialog box, press CTRL-L or from the [...]]]></description>
			<content:encoded><![CDATA[<p>Once you start getting to work on a complex graphic, you&#8217;ll want to use layers. Here&#8217;s what I&#8217;ve found works best for me and seems to flow easily in GIMP. You can start with your own image, or download my classroom graphic here: <a href="http://nancyfusco.com/wp/wp-content/uploads/2009/07/classroom_small.zip">classroom_small_zip</a>.</p>
<p>To view the Layer&#8217;s dialog box, press CTRL-L or from the Dialog menu.</p>
<p>Create a new layer:</p>
<p><a href="http://nancyfusco.com/wp/wp-content/uploads/2009/07/new_layer.jpg"><img class="alignnone size-medium wp-image-808" title="new_layer" src="http://nancyfusco.com/wp/wp-content/uploads/2009/07/new_layer-195x300.jpg" alt="new_layer" width="195" height="300" /></a></p>
<p>Notice that in the dialog box for a new layer you can select different options. I use the &#8220;Transparent&#8221; option most of the time, so my new layer will overlay the background layer. Also notice the size of the new layer. This is where it gets tricky in GIMP. Leave it at the size of the image right now.</p>
<p><a href="http://nancyfusco.com/wp/wp-content/uploads/2009/07/new_layer_dialog_box.jpg"><img class="alignnone size-full wp-image-809" title="new_layer_dialog_box" src="http://nancyfusco.com/wp/wp-content/uploads/2009/07/new_layer_dialog_box.jpg" alt="new_layer_dialog_box" width="294" height="348" /></a></p>
<p>Next, draw a new selection on this new layer and fill it with a color. When you click on a tool in GIMP, the dialog box below the tools area will change to allow for options with that tool. Experiment a bit with that and you&#8217;ll find some cool effects. <span id="more-807"></span></p>
<p><a href="http://nancyfusco.com/wp/wp-content/uploads/2009/07/selection_tool_expanded.jpg"><img class="alignnone size-full wp-image-812" title="selection_tool_expanded" src="http://nancyfusco.com/wp/wp-content/uploads/2009/07/selection_tool_expanded.jpg" alt="selection_tool_expanded" width="239" height="703" /></a></p>
<p>Once you have created a new shape on the layer:</p>
<div id="attachment_811" class="wp-caption alignnone" style="width: 310px"><a href="http://nancyfusco.com/wp/wp-content/uploads/2009/07/selection_fill.jpg"><img class="size-medium wp-image-811" title="selection_fill" src="http://nancyfusco.com/wp/wp-content/uploads/2009/07/selection_fill-300x192.jpg" alt="Click to see a bigger version of this screenshot" width="300" height="192" /></a><p class="wp-caption-text">Click to see a bigger version of this screenshot</p></div>
<p>Click on the Bucket tool and fill it.</p>
<p>Great! You&#8217;ve created a shape that&#8217;s on it&#8217;s own layer! Now if you move that graphic around it will float independant of the lower and upper layers. Oh, wait a minute &#8211; if you move it around you&#8217;re moving a layer the size of the entire graphic, not just the shape you made. This can really get you at the end of your design when you go to print or export &#8211; you&#8217;ll have a layer that is &#8220;over the edge&#8221; of the background layer. Trust me when I say, this is pure GIMP chaos.</p>
<p>So, just as soon as I&#8217;m happy with a shape for that layer I use the Autocrop Layer to resize the layer to just around my shape. Then, when I move the shape around, the layer won&#8217;t go over the edges of the main background layer.</p>
<div id="attachment_810" class="wp-caption alignnone" style="width: 310px"><a href="http://nancyfusco.com/wp/wp-content/uploads/2009/07/autocrop_layer.jpg"><img class="size-medium wp-image-810" title="autocrop_layer" src="http://nancyfusco.com/wp/wp-content/uploads/2009/07/autocrop_layer-300x152.jpg" alt="Click for a bigger version of this screenshot" width="300" height="152" /></a><p class="wp-caption-text">Click for a bigger version of this screenshot</p></div>
<p>Choose, Layer and then Autocrop Layer. Voila! Now, the layer is exactly the size of your shape. What&#8217;s awesome about the Autocrop Layer is if you had multiple shapes and lines on a layer it would Autocrop to the edges of all the elements.</p>
<p>Experiment with this and you&#8217;ll soon see Autocrop Layer is your best friend when working with complex graphic layers.</p>
]]></content:encoded>
			<wfw:commentRss>http://nancyfusco.com/wp/index.php/2009/07/gimp-working-with-layers-and-autocrop-layers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy cropping in Gimp</title>
		<link>http://nancyfusco.com/wp/index.php/2009/06/easy-cropping-in-gimp/</link>
		<comments>http://nancyfusco.com/wp/index.php/2009/06/easy-cropping-in-gimp/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 01:38:50 +0000</pubDate>
		<dc:creator>Nancy</dc:creator>
				<category><![CDATA[graphic design]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://nancyfusco.com/wp/?p=793</guid>
		<description><![CDATA[For an even easier way to crop images in GIMP, use the Selection Tool: 1) Click and drag a selection over the area that you want to remain as your image. 2) From the Image Menu, choose Crop To Selection 3)You now have a quickly cropped picture in GIMP!]]></description>
			<content:encoded><![CDATA[<p>For an even easier way to crop images in GIMP, use the Selection Tool:</p>
<p>1) Click and drag a selection over the area that you want to remain as your image.</p>
<p>2) From the Image Menu, choose Crop To Selection</p>
<p>3)You now have a quickly cropped picture in GIMP!</p>
<p style="text-align: center;"><a href="http://nancyfusco.com/wp/wp-content/uploads/2009/06/crop_to_selection.jpg"><img class="size-medium wp-image-794 aligncenter" style="margin: 5px;" title="crop_to_selection" src="http://nancyfusco.com/wp/wp-content/uploads/2009/06/crop_to_selection-300x216.jpg" alt="Click for a larger screenshot" width="300" height="216" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://nancyfusco.com/wp/index.php/2009/06/easy-cropping-in-gimp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to install true type fonts in Linux Debian</title>
		<link>http://nancyfusco.com/wp/index.php/2009/04/how-to-install-true-type-fonts-in-linux-debian/</link>
		<comments>http://nancyfusco.com/wp/index.php/2009/04/how-to-install-true-type-fonts-in-linux-debian/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 19:27:02 +0000</pubDate>
		<dc:creator>Nancy</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://nancyfusco.com/wp/?p=681</guid>
		<description><![CDATA[First download any True Type Font to your Desktop. If you download a zip file, use ARK to unzip/extract it. ARK is usually at Applications &#124; Accessories. After extraction, you will have a file with the extension .ttf If your extraction left you with file(s) that have multiple underscores or spaces, right-click the file choose [...]]]></description>
			<content:encoded><![CDATA[<p>First download any True Type Font to your Desktop. If you download a zip file, use ARK to unzip/extract it. ARK is usually at Applications | Accessories. After extraction, you will have a file with the extension .ttf</p>
<p>If your extraction left you with file(s) that have multiple underscores or spaces, right-click the file choose Rename. Edit and remove extra spaces and underscores but leave the extension .ttf . This will make it a lot easier to copy these files from the command line as you&#8217;ll see in a moment.</p>
<p>Open up your Terminal as Super User (su). I usually just select Applications | System Tools | Terminal Program &#8211; Super User Mode</p>
<p>Enter your su password.</p>
<p>At the command prompt, path out to your Desktop directory by entering:</p>
<p><code>cd /home/name_of_your_homearea/Desktop</code></p>
<p>*Note: In Linux, case matters, so Desktop must have the capital D.</p>
<p>*Note: Enter the exact name of your home area after /home/</p>
<p>To copy the ttf files to your fonts area, enter this at the command line:</p>
<p><code>cp name_of_file_you_downloaded.ttf /usr/share/fonts/truetype/</code></p>
<p>If you are wanting to copy and entire folder to the fonts area, at the command prompt enter</p>
<p><code>cp /home/name_of_your_homearea/Desktop/folder_name /usr/share/fonts/truetype -r</code></p>
<p>*Note: There is a space after cp and after the folder name in the command line</p>
<p>You will have to <strong>restart your computer</strong> for the changes to go into effect but that&#8217;s it!</p>
<p>If you want to check and make sure the files are successfully copied over, open your file explorer and path up (usually it will default open in your home area, so you&#8217;ll need to use File | Open Parent a few times to get all the way to the top of the file structure. From the top (double-click Computer and choose Filesystem), path out to usr/share/fonts/truetype and you should see all your fonts including the newly copied ones.</p>
<p>*Note: If you can&#8217;t see certain directories, they may be hidden. To view hidden files and folders, select View | Show Hidden from your Explorer window.</p>
<p>Interested in<strong><span style="color: #ff6600;"> installing the Microsoft fonts to your Linux system</span></strong> in one quick download? Check out this fab <a href="http://www.marksanborn.net/linux/installing-microsoft-fonts-msttcorefonts-on-debian-linux/" target="_blank">tutorial</a> by Mark Sanborn.</p>
]]></content:encoded>
			<wfw:commentRss>http://nancyfusco.com/wp/index.php/2009/04/how-to-install-true-type-fonts-in-linux-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP form to email tutorial &#8211; Part 3 &#8211; Javascript validation</title>
		<link>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-3/</link>
		<comments>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-3/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 15:30:28 +0000</pubDate>
		<dc:creator>Nancy</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://nancyfusco.com/wp/?p=653</guid>
		<description><![CDATA[Here in Part 3 we will add Javascript to verify that a Contact Name was filled in before the form goes over to PHP to be processed. This is called client-side validation, since the checks are taking place within the same web page as the form. Again, it&#8217;s just a quick check, so we&#8217;re not [...]]]></description>
			<content:encoded><![CDATA[<p>Here in Part 3 we will add Javascript to verify that a Contact Name was filled in before the form goes over to PHP to be processed. This is called client-side validation, since the checks are taking place within the same web page as the form.</p>
<p>Again, it&#8217;s just a quick check, so we&#8217;re not going to get too fancy with Javascript. If you want to learn serious detail about Javascript, go thru the tutorials at <a href="http://www.tizag.com/javascriptT/" target="_blank">TiZag</a>.</p>
<p>Let&#8217;s get started &#8211; Open up your html editor and then open up your php form page. You should have this code:<br />
<code>&lt;html&gt;<br />
&lt;head&gt;&lt;/head&gt;<br />
&lt;form name="adReg" method="POST" action="adaction2.php"&gt;<br />
Contact Name:<br />
&lt;br /&gt;<br />
&lt;input type="text" name="cName"&gt;<br />
&lt;br /&gt;<br />
Notes:<br />
&lt;br /&gt;<br />
&lt;textarea name="notes"&gt;&lt;/textarea&gt;<br />
&lt;br /&gt;<br />
&lt;input type="submit" name="submit" value="Submit"&gt;<br />
&lt;/form&gt;<br />
&lt;/html&gt;</code></p>
<p>Add the script tag <b>in the Head area</b> to designate this will be a block of Javascript code:<br />
<code>&lt;html&gt;<br />
&lt;head&gt;&lt;script type="text/javascript"&gt;&lt;/head&gt;</code><br />
<span id="more-653"></span><br />
When entering Javascript code, we need to comment it out, so add the starting tag for a comment:<br />
<code>&lt;!--</code></p>
<p>Define and name the function we want to use to validate the form next. We will name the function and then set it to <b>true</b> initially. That way we can use if statements to check and return a <b>false</b> if the field is empty.<br />
<code>function validate_form ( )<br />
{<br />
    valid = true;</code></p>
<p>Here we go with the if statement, take note of the naming structure for pointing to the field we want to check (validate) on our form.<br />
<b>document.formName.fieldName.value</b></p>
<p>To check if it contains any entry, we use the double equals sign to ask if that field contains &#8220;<b>ANYTHING</b> &#8221;<br />
<code>    if ( document.adReg.cName.value == "" )<br />
    {</code></p>
<p>And if it is empty, we return a <b>false</b> to the script so it does not process and instead we can display a message box to the user with an error message:<br />
<code>        alert ( "Please fill in your Name." );<br />
        valid = false;<br />
    }</code></p>
<p>Now close out your tags:<br />
<code>}<br />
//--&gt;<br />
&lt;/script&gt;</code></p>
<p>Ok, so we got our Javascript set but how do we tell the Submit button to go check this script before processing it?</p>
<p>We add a line to our Form tag to have the Submit button run our function before &#8220;submitting&#8221; the form:<br />
<code>&lt;form name="adReg" method="POST" onsubmit="return validate_form ( );" action="adaction2.php"&gt;</code></p>
<p>Sure, there are many ways to expand this validation process in Javascript &#8211; adding in an onFocus line to put the cursor back in the missing content field, for example. For this tutorial series, I just wanted to keep to the basics and give you a good foundation for how things are structured, where they go in the overall scheme of code, how the form relates to PHP, and then let you build from there.</p>
<p>For all you ever wanted to know about Javascript check out <a href="http://www.tizag.com/javascriptT/" target="_blank">TiZag&#8217;s Javascript tutorials</a>.</p>
<p>The full form page should now have this code:<br />
<code><br />
<html><br />
<head><br />
<script type="text/javascript">
<--
function validate_form ( )
{
    valid = true;</p>
<p>    if ( document.adReg.cName.value == "" )
    {
        alert ( "Please fill in your Name." );
        valid = false;
    }
}
//-->
</script><br />
</head></p>
<form name="adReg" method="POST" onsubmit="return validate_form ( );" action="adaction2.php">
Contact Name:<br />
</p>
<input type="text" name="cName">
<br />
Notes:<br />
<br />
<textarea name="notes"></textarea><br />
</p>
<input type="submit" name="submit" value="Submit">
</form>
<p></html></p>
]]></content:encoded>
			<wfw:commentRss>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP form to email tutorial &#8211; Part 2 &#8211; Setting up the PHP</title>
		<link>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-2/</link>
		<comments>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-2/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 15:08:50 +0000</pubDate>
		<dc:creator>Nancy</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://nancyfusco.com/wp/?p=640</guid>
		<description><![CDATA[In Part 1 we setup the actual contact form using basic html form tags and form elements. Here in Part 2, we are going to setup the PHP code to receive the data (or info) from that contact form. Open up your html editor and create a new PHP page. Enter the following code bits, [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-1/" target="_blank">Part 1</a> we setup the actual contact form using basic html form tags and form elements.</p>
<p>Here in Part 2, we are going to setup the PHP code to receive the data (or info) from that contact form. Open up your html editor and create a new PHP page. Enter the following code bits, in order, within PHP tags.</p>
<p>First thing, define the variables. These will be the names of the fields exactly as they are in your contact form. In our example, we had 1 text input box called <b>cName</b> and 1 text area box called <b>notes</b>.</p>
<p>Let&#8217;s also add a few variables that we will use to send our contact form via email. We don&#8217;t need these over on the contact form, but we want to define them here so our PHP script can use them later on.<br />
<code>// define our variables, the info that we will be gathering from the form and any variables we want to use later in the script<br />
$EmailFrom = "youremail_here@where.com";<br />
$EmailTo = "youremail_here@where.com";<br />
$Subject = "Contact Form";<br />
$cName = Trim(stripslashes($_POST['cName']));<br />
$notes = Trim(stripslashes($_POST['notes'])); </code></p>
<p>It&#8217;s often handy to have the user&#8217;s IP address passed along for troubleshooting if needed, so let&#8217;s add in a variable for that:<br />
<code>$user_ip = ($_SERVER['X_FORWARDED_FOR']) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];</code></p>
<p>Ok, now that everything&#8217;s defined, let&#8217;s setup what the email message should look like when it&#8217;s received. <span id="more-640"></span> Here we are basically just formatting the look of the message body, making it more readable.<br />
<code>// formatting the data for the email message body<br />
$Body .= "Contact Name: ";<br />
$Body .= $cName;<br />
$Body .= "\n";<br />
$Body .= "Notes: ";<br />
$Body .= $notes;<br />
$Body .= "\n";<br />
$Body .= "Users IP: ";<br />
$Body .= $user_ip;<br />
$Body .= "\n";</code></p>
<p>Here is a quick check to see if a spambot is adding emails to our form. This is just a basic check, so at some point your going to want to make sure your form isn&#8217;t being used by a spammer. I will talk more about this in Part 3 &#8211; validation.</p>
<p>For now, let&#8217;s just do a simple check to see if an extra line or breaking space is being inserted in either the Name text box.<br />
<code>if ( ereg( "[\r\n]", $cName )) ) {</p>
<p>	//if spambot send directly to error page</p>
<p>	print "&lt;meta http-equiv=\"refresh\" content=\"0;URL=error.php\"&gt;" ;</code></p>
<p>Ok, so now that we&#8217;ve used an &#8220;if&#8221; statement to check and re-route to an error page if they are a spammer, what do we do if it&#8217;s ok to send the form? We use the &#8220;else&#8221; statement, like this:<br />
<code>// if all good then send our contact form via email and display the results</p>
<p>} else {</p>
<p>// send email to the address specified above and include the data<br />
$success = mail($EmailTo, $Subject, $Body, "From:youremail_here@where.com");</code><br />
And finally, we display the info that the user entered in the form as confirmation that it was sent and so they have a copy for their records. It also let&#8217;s us say &#8220;Thank you!&#8221; for sending the message:<br />
<code>// display results on page so the user has confirmation of their form details<br />
echo "&lt;h3&gt;Thank you! We have received your message!&lt;/h3&gt;";<br />
echo "&lt;br /&gt;";<br />
echo "&lt;br /&gt;";<br />
echo "&lt;p&gt;Hello ".$cName.", &lt;/p&gt;";<br />
echo "&lt;br /&gt;";<br />
echo "&lt;p&gt;Following are the details of your message:&lt;/p&gt;";<br />
echo "&lt;br /&gt;";<br />
echo "&lt;p&gt;".$cName."&lt;/p&gt;";<br />
echo "&lt;br /&gt;";<br />
echo "&lt;p&gt;Your message was: &lt;/p&gt;";<br />
echo "&lt;p&gt;<i>".$notes."</i>&lt;/p&gt;";<br />
echo "&lt;br /&gt;";<br />
}</code></p>
<p>So, that&#8217;s it! Not too bad right? Remember to type the code snippets above inside PHP tags and to save the file as adaction2.php before testing. If you want to change the name of this file, be sure and go back to your form and edit the form tag so it knows where to send this data:<br />
<code>&lt;form name="adReg" method="POST" action="adaction2.php"&gt;</code></p>
<p>To learn PHP in more detail, check out <a href="http://www.tizag.com/phpT/index.php" target="_blank">TiZag</a> &#8211; many props to TiZag &#8211; I learned more from his tutorials than anywhere on the web.</p>
<p>And to get some additional code samples, check out Steve&#8217;s site <a href="http://www.stevedawson.com/download.php" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP form to email tutorial &#8211; Part 1 &#8211; Setting up the form</title>
		<link>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-1/</link>
		<comments>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-1/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 17:47:43 +0000</pubDate>
		<dc:creator>Nancy</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://nancyfusco.com/wp/?p=629</guid>
		<description><![CDATA[This weekend I did some volunteer work for a local non-profit by constructing an online form in php that would email from their website. I&#8217;m going to simplify that form and walk thru a tutorial to help you build your own online php forms. Part 1 will walk you thru setting up the actual form [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I did some volunteer work for a local non-profit by constructing an online form in php that would email from their website. I&#8217;m going to simplify that form and walk thru a tutorial to help you build your own online php forms.</p>
<p>Part 1 will walk you thru setting up the actual form to get it ready to be processed by the PHP script. The form just gets the information to the PHP script. </p>
<p><a href="http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-2/" target="_blank">Part 2</a> will be the setup of the receiving PHP script, which will process the info from the form and email it.</p>
<p><a href="http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-3/" target="_blank">Part 3</a> will look at client-side validation with Javascript.</p>
<p>Part 4 we will create a multiple choice input area for the user, and only emailing their selections in the form. We will do this by creating an Array.</p>
<p>Part 5 will create code to also email a confirmation to the user with the info they filled out.</p>
<p>A well designed form will set the stage for easy processing so, with that said, let&#8217;s dive into the form construction. <span id="more-629"></span></p>
<p>Open your html editor, for most it will be Dreamweaver or similar. I use <a href="http://quanta.kdewebdev.org/" target="_blank">Quanta+</a>, an open-source software for Linux. Create a new PHP document.</p>
<p>First, let&#8217;s add the form elements to our web page, take notice that we are defining the name, method, and action:<br />
<code>&lt;html&gt;<br />
&lt;head&gt;&lt;/head&gt;<br />
&lt;form name="adReg" method="POST" action="adaction2.php"&gt;<br />
&lt;/form&gt;<br />
&lt;/html&gt;</code></p>
<p>name = how we will refer to our form<br />
method = POST &#8211; how we will send our data over to PHP &#8211; this is the transport<br />
action = when a user clicks the Submit button, where the form should send it&#8217;s data.</p>
<p>Now, inside the form tags, let&#8217;s add just two items, keeping it simple for right now:<br />
<code>&lt;form name="adReg" method="POST" action="adaction2.php"&gt;<br />
Contact Name:<br />
&lt;input type="text" name="cName"&gt;<br />
Notes:<br />
&lt;textarea name="notes"&gt;&lt;/textarea&gt;<br />
&lt;/form&gt;</code></p>
<p>Notice again, we have to define the elements in our form so that in our PHP script we know how to refer to them.</p>
<p>All we need to do now is add in the Submit button and a few line breaks for spacing:</p>
<p><code>&lt;html&gt;<br />
&lt;head&gt;&lt;/head&gt;<br />
&lt;form name="adReg" method="POST" action="adaction2.php"&gt;<br />
Contact Name:<br />
&lt;br /&gt;<br />
&lt;input type="text" name="cName"&gt;<br />
&lt;br /&gt;<br />
Notes:<br />
&lt;br /&gt;<br />
&lt;textarea name="notes"&gt;&lt;/textarea&gt;<br />
&lt;br /&gt;<br />
&lt;input type="submit" name="submit" value="Submit"&gt;<br />
&lt;/form&gt;<br />
&lt;/html&gt;</code></p>
<p>Preview your PHP page and you should see this basic form:</p>
<form name="adReg" method="POST" action="adaction2.php">
Contact Name:<br />
</p>
<input type="text" name="cName">
<br />
Notes:<br />
<br />
<textarea name="notes"></textarea><br />
</p>
<input type="submit" name="submit" value="Submit">
</form>
<p>That&#8217;s it! Pretty easy right? Now if you click the Submit button above, it won&#8217;t actually do anything &#8211; yet &#8211; visit back for Part 2 where we will construct the actual PHP code that will take the info from the form we created and send it via email.</p>
]]></content:encoded>
			<wfw:commentRss>http://nancyfusco.com/wp/index.php/2009/03/php-form-to-email-tutorial-part-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

