<?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>Hektor Paris</title>
	<atom:link href="http://www.hektorparis.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hektorparis.com</link>
	<description>Web developer &#38; designer in New York City.</description>
	<lastBuildDate>Sat, 15 May 2010 07:01:42 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MySQL and jQuery Sliding Login Panel</title>
		<link>http://www.hektorparis.com/mysql-and-jquery-sliding-login-panel/</link>
		<comments>http://www.hektorparis.com/mysql-and-jquery-sliding-login-panel/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 15:49:27 +0000</pubDate>
		<dc:creator>Hektor</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jquery login]]></category>
		<category><![CDATA[mysql login]]></category>
		<category><![CDATA[mysql login tutorial]]></category>
		<category><![CDATA[php login tutorial]]></category>
		<category><![CDATA[sliding login panel]]></category>

		<guid isPermaLink="false">http://www.hektorparis.com/?p=783</guid>
		<description><![CDATA[The purpose of having a sliding login panel is to make your website user-friendly as well as practical, by providing a login and logout feature without redirecting users away from any content on your website.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-785" title="Nice and Clean Sliding Login Panel built with jQuery" src="http://www.hektorparis.com/wp-content/uploads/2009/09/sliding_login_panel_built_with_jquery.gif" alt="Nice and Clean Sliding Login Panel built with jQuery" width="320" height="240" />The <a title="Nice &amp; Clean Sliding Login Panel built with jQuery" href="http://web-kreation.com/index.php/tutorials/nice-clean-sliding-login-panel-built-with-jquery/" target="_blank">Sliding Login Panel with jQuery</a> (v 1.3.2) is easy to integrate and an extremely efficient way to allow users to login from any page throughout your website. Using the <a title="jQuery jQuery is a new kind of JavaScript Library." href="http://jquery.com/" target="_blank">jQuery</a> JS framework, the sliding panel works like a charm in <a title="Firefox web browser | Faster, more secure, &amp; customizable" href="http://www.mozilla.com/firefox/" target="_blank">Firefox</a>, <a title="The world's fastest and most innovative web browser for Mac and PC" href="http://www.apple.com/safari/" target="_blank">Safari</a>, <a title="Opera gives you the full Web experience everywhere." href="http://www.opera.com/" target="_blank">Opera</a>, <a title="Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier." href="http://www.google.com/chrome" target="_blank">Chrome</a> and even inferior browsers like IE6, IE7 and IE8!</p>
<p>The purpose of having a sliding login panel is to make your website user-friendly as well as practical, by providing a login and logout feature without redirecting users away from any content on your website. The Sliding Login Panel with jQuery overlaps content instead of shifting it down, and since all images are transparent that means you can retain the background content intact.  <span id="more-783"></span></p>
<p><strong><a title="Nice &amp; Clean Sliding Login Panel built with jQuery" href="http://www.hektorparis.com/hp-lab/mysql-and-jquery-sliding-login-panel/" target="_blank">See Demo Here &gt;&gt;</a></strong><br />
<br class="clear" /><br />
<strong>Read Me</strong><br />
This tutorial will demonstrate how to create a login system using <a title="PHP: Hypertext Preprocessor" href="http://www.php.net/" target="_blank">PHP</a>, <a title="The software's official homepage with news, downloads and documentation." href="http://www.mysql.com/" target="_blank">MySQL</a> and the Sliding Login Panel with jQuery. If you don&#8217;t already have a MySQL database with an users table, below I will show you how to begin from scratch. To proceed with this tutorial you will need to have a <a title="Comprehensive information and resources about the Linux Operating System." href="http://www.linux.org" target="_blank">Linux</a> web hosting environment with a MySQL database accessible preferably via <a title="phpMyAdmin is a free software tool written in PHP intended to handle the administration of MySQL over the World Wide Web." href="http://www.phpmyadmin.net" target="_blank">phpMyAdmin</a>.</p>
<p>You will also need to download the Sliding_login_panel_jquery.zip file <a title="Sliding Login Panel with jQuery (v 1.3.2)" href="http://web-kreation.com/index.php/tutorials/nice-clean-sliding-login-panel-built-with-jquery/" target="_blank">from here</a>.</p>
<p><strong>Create &#8220;Members&#8221; Table</strong><br />
Using phpMyAdmin create a &#8220;members&#8221; table to use for storing user accounts. The following SQL query will create a table with two fields to store an username and password. However, you can add more fields to log IP address, last login time, user verified, etc.</p>
<p><strong><a title="CREATE TABLE Syntax" href="http://dev.mysql.com/doc/refman/5.1/en/create-table.html" target="_blank">CREATE TABLE</a></strong> `members` (`members_id` <a title="Using AUTO_INCREMENT" href="http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html" target="_blank">SERIAL</a> <a title="Working with NULL Values" href="http://dev.mysql.com/doc/refman/5.0/en/working-with-null.html" target="_blank">NOT NULL</a>, `members_username` <a title="The CHAR and VARCHAR Types" href="http://dev.mysql.com/doc/refman/5.0/en/char.html" target="_blank">VARCHAR</a>(65) NOT NULL, `members_password` VARCHAR(65) NOT NULL, <a title="PRIMARY KEY and UNIQUE Index Constraints" href="http://dev.mysql.com/doc/refman/5.0/en/constraint-primary-key.html" target="_blank">PRIMARY KEY</a> (`members_id`))<br />
<strong>TYPE</strong> = <a title="The MyISAM Storage Engine" href="http://dev.mysql.com/doc/refman/5.0/en/myisam-storage-engine.html" target="_blank">MyISAM</a> <a title="Using AUTO_INCREMENT" href="http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html" target="_blank">AUTO_INCREMENT</a> = 1;</p>
<p>&#8211;<br />
&#8211; Now dump data for table &#8220;members&#8221;<br />
&#8211;</p>
<p><strong><a title="INSERT Syntax" href="http://dev.mysql.com/doc/refman/5.1/en/insert.html" target="_blank">INSERT</a> INTO</strong> `members`Â  <a title="Data Type Default Values" href="http://dev.mysql.com/doc/refman/5.0/en/data-type-defaults.html" target="_blank"><strong>VALUES</strong> </a>(NULL, &#8216;hektor@myserver.com&#8217;, md5(&#8216;testPW123&#8242;));</p>
<p>This SQL query will result in:</p>
<p style="text-align: center;"><img src="http://www.hektorparis.com/wp-content/uploads/2009/09/members_table_snapshot.gif" alt="Members Table" title="Members Table" width="602" height="143" class="aligncenter size-full wp-image-813" /></p>
<p><br class="clear" /><br />
<strong>Security</strong><br />
SQL injections are a common method that allow malicious access to your database. Such SQL injection attacks are the act of hackers using an HTML form to submit a MySQL statement that exploits raw processing of user input data. For example, a login form has two input fields, username and password, which are submitted to a MySQL SELECT query that returns matches found. However, an SQL injection will attempt to make the query behave differently.</p>
<p>SQL injection example:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="re0">$username</span> <span class="sy0">=</span> <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&quot;username&quot;</span><span class="br0">&#93;</span><span class="sy0">;</span> <span class="co1">//Suppose the input value is &quot;hektor&quot;</span><br />
<span class="re0">$query</span> <span class="sy0">=</span> <span class="st0">&quot;SELECT * FROM members WHERE username = 'hektor@myserver.com'&quot;</span><span class="sy0">;</span> <span class="co1">//Valid SQL statement</span><br />
<br />
<span class="co1">//Now the same variable with an SQL injection</span><br />
<span class="re0">$username</span> <span class="sy0">=</span> <span class="st0">&quot;' OR 1'&quot;</span><span class="sy0">;</span><br />
<span class="co1">//The SQL query will be compromised and behave differently</span><br />
<span class="re0">$query</span> <span class="sy0">=</span> <span class="st0">&quot;SELECT * FROM member WHERE username = '' OR 1'&quot;</span> <span class="co1">//SQL injection</span></div></td></tr></tbody></table></div>
<p>By using the OR operand in conjunction with the single quote symbol (&#8216;), the SQL query conditional statement ends the username string prematurely, resulting in a valid SQL statement that will always return true. The MySQL WHERE clause followed by the OR operand accompanied with a 1 alters the conditional statement to always return true. The consequences of using username = &#8221; OR 1 will be that the entire members table will be selected by this SQL injection.</p>
<p>To prevent SQL injection attacks, use the <a title="mysql_real_escape_string() escapes special characters in a string for use in a SQL statement" href="http://us3.php.net/mysql_real_escape_string" target="_blank">mysql_real_escape_string()</a> PHP function to escape special characters in a string for use in a SQL statement. The function escapes special characters while taking into account the current character set of the connection so that it is safe to place it in the <a title="mysql_query sends a MySQL query" href="http://us3.php.net/manual/en/function.mysql-query.php" target="_blank">mysql_query()</a> function. A call to the MySQL library function    <span style="color: #0000ff;">mysql_real_escape_string()</span> prepends backslashes to the following characters:    <em>\x00</em>, <em>\n</em>,    <em>\r</em>, <em>\</em>, <em>&#8216;</em>,    <em>&#8220;</em> and <em>\x1a</em>.</p>
<p><u> This function must always (with few exceptions) be used to make data    safe before sending a query to MySQL. </u></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="co1">//escape the string before assigning it to the variable</span><br />
<span class="re0">$username</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_real_escape_string"><span class="kw3">mysql_real_escape_string</span></a><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&quot;username&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// ' OR 1'</span><br />
<br />
<span class="co1">//SELECT * FROM members WHERE members_username = '\' OR 1\''</span><br />
<span class="re0">$query</span> <span class="sy0">=</span> <span class="st0">&quot;SELECT * FROM members WHERE members_username = '<span class="es4">$username</span>'&quot;</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
<p><br class="clear" /><br />
<strong>Create Database Configuration File</strong><br />
The next step is to create a database configuration file to connect to the member&#8217;s table and validate login attempts.</p>
<p>db_config.inc.php</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="co1">//Define database connection</span><br />
<span class="re0">$hostname</span> <span class="sy0">=</span> <span class="st0">&quot;db.myserver.com&quot;</span><span class="sy0">;</span><br />
<span class="re0">$username</span> <span class="sy0">=</span> <span class="st0">&quot;hektor&quot;</span><span class="sy0">;</span><br />
<span class="re0">$password</span> <span class="sy0">=</span> <span class="st0">&quot;testPW123&quot;</span><span class="sy0">;</span><br />
<span class="re0">$dbname</span> &nbsp; <span class="sy0">=</span> <span class="st0">&quot;sqldb&quot;</span><span class="sy0">;</span><br />
<br />
<a href="http://www.php.net/mysql_connect"><span class="kw3">mysql_connect</span></a><span class="br0">&#40;</span><span class="re0">$hostname</span><span class="sy0">,</span> <span class="re0">$username</span><span class="sy0">,</span> <span class="re0">$password</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a><span class="br0">&#40;</span><span class="st0">&quot;Cannot connect: &quot;</span> <span class="sy0">.</span><a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<a href="http://www.php.net/mysql_select_db"><span class="kw3">mysql_select_db</span></a><span class="br0">&#40;</span><span class="re0">$dbname</span><span class="br0">&#41;</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
<p><br class="clear" /><br />
<strong>Create a Registration and Login Script</strong><br />
If you would like to retain the Sliding Login Panel&#8217;s default columns, member login and registration, you can process both using a single script.</p>
<p>login.php</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><a href="http://www.php.net/session_start"><span class="kw3">session_start</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
<span class="kw1">include</span><span class="br0">&#40;</span><span class="st0">&quot;db_config.inc.php&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">//establish DB connection</span><br />
<br />
<span class="co1">//capture all form fields and set as variables</span><br />
<span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re0">$_POST</span> <span class="kw1">as</span> <span class="re0">$field</span> <span class="sy0">=&gt;</span> <span class="re0">$value</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="re0">$$field</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_real_escape_string"><span class="kw3">mysql_real_escape_string</span></a><span class="br0">&#40;</span><span class="re0">$value</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="br0">&#125;</span><br />
<br />
<span class="co1">//authenticate login attempts</span><br />
<span class="kw1">if</span><span class="br0">&#40;</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&quot;login&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span><a href="http://www.php.net/empty"><span class="kw3">empty</span></a><span class="br0">&#40;</span><span class="re0">$email</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="re0">$query</span> <span class="sy0">=</span> <span class="st0">&quot;SELECT * FROM members WHERE members_username = '&quot;</span> <span class="sy0">.</span><span class="re0">$email</span> <span class="sy0">.</span><span class="st0">&quot;' AND members_password = '&quot;</span> <span class="sy0">.</span><a href="http://www.php.net/md5"><span class="kw3">md5</span></a><span class="br0">&#40;</span><span class="re0">$password</span><span class="br0">&#41;</span> <span class="sy0">.</span><span class="st0">&quot;'&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="re0">$find_user</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$query</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><a href="http://www.php.net/mysql_num_rows"><span class="kw3">mysql_num_rows</span></a><span class="br0">&#40;</span><span class="re0">$find_user</span><span class="br0">&#41;</span> <span class="sy0">&gt;</span> <span class="nu0">0</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="re0">$result</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_fetch_array"><span class="kw3">mysql_fetch_array</span></a><span class="br0">&#40;</span><span class="re0">$find_user</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span class="co1">//register user session</span><br />
&nbsp; &nbsp; &nbsp; <span class="re0">$_SESSION</span><span class="br0">&#91;</span><span class="st0">&quot;user_sid&quot;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <a href="http://www.php.net/md5"><span class="kw3">md5</span></a><span class="br0">&#40;</span><span class="re0">$result</span><span class="br0">&#91;</span><span class="st0">&quot;members_username&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span class="co1">//redirect authenticated users</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.php.net/header"><span class="kw3">header</span></a><span class="br0">&#40;</span><span class="st0">&quot;Location: login_success.php&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="co1">//implement your custom error handling method</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;Cannot validate your login credentials.&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="co1">//register new users</span><br />
<span class="kw1">if</span><span class="br0">&#40;</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">&quot;register&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span><a href="http://www.php.net/empty"><span class="kw3">empty</span></a><span class="br0">&#40;</span><span class="re0">$signup_email</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> <span class="sy0">!</span><a href="http://www.php.net/empty"><span class="kw3">empty</span></a><span class="br0">&#40;</span><span class="re0">$signup_password</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="re0">$insert_user</span> <span class="sy0">=</span> <span class="st0">&quot;INSERT INTO members(members_username, members_password) VALUES('&quot;</span> <span class="sy0">.</span><span class="re0">$signup_email</span> <span class="sy0">.</span><span class="st0">&quot;', '&quot;</span> <span class="sy0">.</span><a href="http://www.php.net/md5"><span class="kw3">md5</span></a><span class="br0">&#40;</span><span class="re0">$signup_password</span><span class="br0">&#41;</span> <span class="sy0">.</span><span class="st0">&quot;')&quot;</span><span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$insert_user</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="co1">//implement your custom success method</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;User account created successfully&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="co1">//implement your custom error handling method</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.php.net/die"><span class="kw3">die</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; <span class="kw1">else</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co1">//implement your custom error handling method</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;You must provide a valid email address and password.&quot;</span><span class="sy0">;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div></td></tr></tbody></table></div>
<p><br class="clear" /><br />
<strong>Modify Sliding Login Panel</strong><br />
Now rename the input fields in the form to make it work with the <b>login.php</b> script.</p>
<p>index.html</p>
<div class="codecolorer-container html4strict mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br /></div></td><td><div class="html4strict codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc-1">&lt;!-- Login Form --&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/form.html"><span class="kw2">form</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;clearfix&quot;</span> <span class="kw3">action</span><span class="sy0">=</span><span class="st0">&quot;login.php&quot;</span> <span class="kw3">method</span><span class="sy0">=</span><span class="st0">&quot;post&quot;</span>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/h1.html"><span class="kw2">h1</span></a>&gt;</span>Member Login<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/h1.html"><span class="kw2">h1</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;grey&quot;</span> <span class="kw3">for</span><span class="sy0">=</span><span class="st0">&quot;log&quot;</span>&gt;</span>Email:<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;email&quot;</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;field&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;email&quot;</span> <span class="kw3">size</span><span class="sy0">=</span><span class="st0">&quot;23&quot;</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text&quot;</span> <span class="sy0">/</span>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;grey&quot;</span> <span class="kw3">for</span><span class="sy0">=</span><span class="st0">&quot;pwd&quot;</span>&gt;</span>Password:<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;password&quot;</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;field&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;password&quot;</span> <span class="kw3">size</span><span class="sy0">=</span><span class="st0">&quot;23&quot;</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;password&quot;</span> <span class="sy0">/</span>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;bt_login&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;login&quot;</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;submit&quot;</span> <span class="kw3">value</span><span class="sy0">=</span><span class="st0">&quot;Login&quot;</span> <span class="sy0">/</span>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;lost-pwd&quot;</span> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;#&quot;</span>&gt;</span>Lost your password?<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a>&gt;</span><br />
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/form.html"><span class="kw2">form</span></a>&gt;</span><br />
<br />
<span class="sc-1">&lt;!-- Register Form --&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/form.html"><span class="kw2">form</span></a> <span class="kw3">action</span><span class="sy0">=</span><span class="st0">&quot;login.php&quot;</span> <span class="kw3">method</span><span class="sy0">=</span><span class="st0">&quot;post&quot;</span>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/h1.html"><span class="kw2">h1</span></a>&gt;</span>Not a member yet? Sign Up!<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/h1.html"><span class="kw2">h1</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;grey&quot;</span> <span class="kw3">for</span><span class="sy0">=</span><span class="st0">&quot;signup&quot;</span>&gt;</span>Email:<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;signup_email&quot;</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;field&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;signup_email&quot;</span> <span class="kw3">size</span><span class="sy0">=</span><span class="st0">&quot;23&quot;</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text&quot;</span> <span class="sy0">/</span>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;grey&quot;</span> <span class="kw3">for</span><span class="sy0">=</span><span class="st0">&quot;email&quot;</span>&gt;</span>Password:<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;signup_password&quot;</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;field&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;signup_password&quot;</span> <span class="kw3">size</span><span class="sy0">=</span><span class="st0">&quot;23&quot;</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text&quot;</span> <span class="sy0">/</span>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span>A password will be e-mailed to you.<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;bt_register&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;register&quot;</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;submit&quot;</span> <span class="kw3">value</span><span class="sy0">=</span><span class="st0">&quot;Register&quot;</span> <span class="sy0">/</span>&gt;</span><br />
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/form.html"><span class="kw2">form</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p><br class="clear" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hektorparis.com/mysql-and-jquery-sliding-login-panel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Form Validation Before Submit</title>
		<link>http://www.hektorparis.com/javascript-form-validation-before-submit/</link>
		<comments>http://www.hektorparis.com/javascript-form-validation-before-submit/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 09:32:57 +0000</pubDate>
		<dc:creator>Hektor</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[how to validate form]]></category>
		<category><![CDATA[html form validation]]></category>
		<category><![CDATA[javascript field validation]]></category>
		<category><![CDATA[javascript form validation]]></category>
		<category><![CDATA[validate form fields]]></category>
		<category><![CDATA[validate form with javascript]]></category>
		<category><![CDATA[validate html form]]></category>

		<guid isPermaLink="false">http://www.hektorparis.com/?p=771</guid>
		<description><![CDATA[Client-side form validation with Javascript is easy to implement and convenient to use as it allows you to verify input fields before submitting the data to a server-side script.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-773" title="Validate inputs using javascript before submitting the form" src="http://www.hektorparis.com/wp-content/uploads/2009/09/js_form_validation.png" alt="Validate inputs using javascript before submitting the form" width="320" height="240" /><a title="Client-Side Scripting 101" href="http://www.webreference.com/html/tutorial16/" target="_blank">Client-side</a> form validation with <a title="Javascript" href="http://www.javascript.com/" target="_blank">Javascript</a> is easy to implement and convenient to use as it allows you to verify input fields before submitting the data to a <a title="Server-side Scripting Techniques" href="http://www.w3.org/TR/2008/WD-WCAG20-TECHS-20080430/server-side-script.html" target="_blank">server-side script</a>. Using Javascript to check required form fields is important in avoiding spam, blank submissions and to help you maintain data consistency.</p>
<p>Learn how to validate input fields in <a title="Introduction to HTML forms" href="http://www.w3.org/TR/html401/interact/forms.html#h-17.1" target="_blank">HTML forms</a> using a single Javascript function that highlights empty required fields before sending the content off to a <a title="Hypertext Preprocessor" href="http://www.php.net/" target="_blank">PHP</a> script, for example. <span id="more-771"></span><br />
<br class="clear" /></p>
<p><strong><a title="Javascript Form Validation" href="http://www.hektorparis.com/hp-lab/javascript_form_validation/" target="_blank">See Demo</a></strong></p>
<p><strong>Required Fields</strong><br />
The <span style="color:#0033ff;">validateForm()</span> function below contains a list of conditional statements that check the value of each specified input. If a required field is empty, the CSS class for that input will change to highlight the field in red, then the variable &#8220;error&#8221; which begins as false, will be set to true to prevent form submission until all required fields are satisfied. Highlighted fields that have been filled out will return to the default CSS class upon re-validating the form. The function below also checks the general syntax of an email address. The input data must contain the @ symbol and a dot (.)<br />
<br class="clear" /></p>
<div class="codecolorer-container javascript mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br /></div></td><td><div class="javascript codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw2">function</span> validateForm<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw2">var</span> input <span class="sy0">=</span> document.<span class="me1">myForm</span><span class="sy0">;</span>&nbsp; &nbsp; <span class="co1">// Your form name</span><br />
&nbsp; &nbsp; <span class="kw2">var</span> error <span class="sy0">=</span> <span class="kw2">false</span><span class="sy0">;</span> &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// No erros by default</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">// Restore CSS classes to the default so that when the form is re-checked the UI updates</span><br />
&nbsp; &nbsp; input.<span class="me1">inquiry</span>.<span class="me1">className</span> <span class="sy0">=</span> input.<span class="kw3">name</span>.<span class="me1">className</span> <span class="sy0">=</span> input.<span class="me1">email</span>.<span class="me1">className</span> <span class="sy0">=</span> input.<span class="me1">message</span>.<span class="me1">className</span> <span class="sy0">=</span> <span class="st0">''</span><span class="sy0">;</span><br />
&nbsp; &nbsp; document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">'inquiryLabel'</span><span class="br0">&#41;</span>.<span class="me1">className</span> <span class="sy0">=</span> document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">'nameLabel'</span><span class="br0">&#41;</span>.<span class="me1">className</span> <span class="sy0">=</span> <br />
&nbsp; &nbsp; document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">'emailLabel'</span><span class="br0">&#41;</span>.<span class="me1">className</span> &nbsp; <span class="sy0">=</span> document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">'messageLabel'</span><span class="br0">&#41;</span>.<span class="me1">className</span> <span class="sy0">=</span> <span class="st0">'label'</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>input.<span class="me1">inquiry</span>.<span class="me1">value</span> <span class="sy0">==</span> <span class="st0">'null'</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; input.<span class="me1">inquiry</span>.<span class="me1">className</span> <span class="sy0">=</span> <span class="st0">'inputError'</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">'inquiryLabel'</span><span class="br0">&#41;</span>.<span class="me1">className</span> <span class="sy0">=</span> <span class="st0">'errorLabel'</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; input.<span class="me1">inquiry</span>.<span class="kw3">focus</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; error <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>input.<span class="kw3">name</span>.<span class="me1">value</span> <span class="sy0">==</span> <span class="st0">''</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; input.<span class="kw3">name</span>.<span class="me1">className</span> <span class="sy0">=</span> <span class="st0">'inputError'</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">'nameLabel'</span><span class="br0">&#41;</span>.<span class="me1">className</span> <span class="sy0">=</span> <span class="st0">'errorLabel'</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; input.<span class="kw3">name</span>.<span class="kw3">focus</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; error <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>input.<span class="me1">email</span>.<span class="me1">value</span>.<span class="me1">indexOf</span><span class="br0">&#40;</span><span class="st0">&quot;@&quot;</span><span class="br0">&#41;</span> <span class="sy0">&gt;</span> <span class="nu0">0</span> <span class="sy0">&amp;&amp;</span> input.<span class="me1">email</span>.<span class="me1">value</span>.<span class="me1">indexOf</span><span class="br0">&#40;</span><span class="st0">&quot;.&quot;</span><span class="br0">&#41;</span> <span class="sy0">&gt;</span> <span class="nu0">2</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Email address seems well formed</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; input.<span class="me1">email</span>.<span class="me1">className</span> <span class="sy0">=</span> <span class="st0">'inputError'</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">'emailLabel'</span><span class="br0">&#41;</span>.<span class="me1">className</span> <span class="sy0">=</span> <span class="st0">'errorLabel'</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; input.<span class="me1">email</span>.<span class="kw3">focus</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; error <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>input.<span class="me1">message</span>.<span class="me1">value</span> <span class="sy0">==</span> <span class="st0">''</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; input.<span class="me1">message</span>.<span class="me1">className</span> <span class="sy0">=</span> <span class="st0">'inputError'</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">'messageLabel'</span><span class="br0">&#41;</span>.<span class="me1">className</span> <span class="sy0">=</span> <span class="st0">'errorLabel'</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; input.<span class="me1">message</span>.<span class="kw3">focus</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; error <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">// Submit form if after validation error = false</span><br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span>error<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; document.<span class="me1">myForm</span>.<span class="me1">submit</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; <span class="br0">&#125;</span></div></td></tr></tbody></table></div>
<p><br class="clear" /><br />
<b>Styling</b><br />
The CSS classes are very simple and use the color red to highlight empty input fields.</p>
<div class="codecolorer-container css mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="css codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="re1">.label</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">color</span><span class="sy0">:</span><span class="re0">#000000</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;<br />
&nbsp;<span class="re1">.errorLabel</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">color</span><span class="sy0">:</span><span class="re0">#FF0000</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">font-weight</span><span class="sy0">:</span><span class="kw2">bold</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;<br />
&nbsp;<span class="re1">.inputError</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">border</span><span class="sy0">:</span><span class="re3">1px</span> <span class="re0">#FF0000</span> <span class="kw2">solid</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">background-color</span><span class="sy0">:</span><span class="re0">#FFDDDD</span><span class="sy0">;</span><br />
&nbsp;<span class="br0">&#125;</span></div></td></tr></tbody></table></div>
<p><br class="clear" /><br />
<b>HTML Form</b><br />
The form below contains commonly used input types including text, textarea and select.</p>
<div class="codecolorer-container html4strict mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br /></div></td><td><div class="html4strict codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc2">&lt;<a href="http://december.com/html/4/element/form.html"><span class="kw2">form</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;myForm&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;myForm&quot;</span> <span class="kw3">method</span><span class="sy0">=</span><span class="st0">&quot;post&quot;</span> <span class="kw3">action</span><span class="sy0">=</span><span class="st0">&quot;test.php&quot;</span>&gt;</span><br />
&nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/fieldset.html"><span class="kw2">fieldset</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;content&quot;</span>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/legend.html"><span class="kw2">legend</span></a>&gt;&lt;<a href="http://december.com/html/4/element/b.html"><span class="kw2">b</span></a>&gt;</span>Javascript Form Validation<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/b.html"><span class="kw2">b</span></a>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/legend.html"><span class="kw2">legend</span></a>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/table.html"><span class="kw2">table</span></a> <span class="kw3">width</span><span class="sy0">=</span><span class="st0">&quot;100%&quot;</span> <span class="kw3">cellspacing</span><span class="sy0">=</span><span class="st0">&quot;0&quot;</span> <span class="kw3">cellpadding</span><span class="sy0">=</span><span class="st0">&quot;0&quot;</span> <span class="kw3">border</span><span class="sy0">=</span><span class="st0">&quot;0&quot;</span>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/tr.html"><span class="kw2">tr</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/td.html"><span class="kw2">td</span></a> <span class="kw3">align</span><span class="sy0">=</span><span class="st0">&quot;right&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;required-field&quot;</span>&gt;</span>*<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a>&gt;</span> Required<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/td.html"><span class="kw2">td</span></a>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/tr.html"><span class="kw2">tr</span></a>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/tr.html"><span class="kw2">tr</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/td.html"><span class="kw2">td</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;inquiryLabel&quot;</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;label&quot;</span>&gt;</span>Inquiry Type<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/br.html"><span class="kw2">br</span></a> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/select.html"><span class="kw2">select</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;inquiry&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;inquiry_type&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/option.html"><span class="kw2">option</span></a> <span class="kw3">value</span><span class="sy0">=</span><span class="st0">&quot;null&quot;</span> selected&gt;</span>Select<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/option.html"><span class="kw2">option</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/option.html"><span class="kw2">option</span></a> <span class="kw3">value</span><span class="sy0">=</span><span class="st0">&quot;1&quot;</span>&gt;</span>Support<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/option.html"><span class="kw2">option</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/option.html"><span class="kw2">option</span></a> <span class="kw3">value</span><span class="sy0">=</span><span class="st0">&quot;2&quot;</span>&gt;</span>Get a Quote<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/option.html"><span class="kw2">option</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/select.html"><span class="kw2">select</span></a>&gt;&lt;<a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;required-field&quot;</span>&gt;</span>*<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/td.html"><span class="kw2">td</span></a>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/tr.html"><span class="kw2">tr</span></a>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/tr.html"><span class="kw2">tr</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/td.html"><span class="kw2">td</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;nameLabel&quot;</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;label&quot;</span>&gt;</span>Full Name:<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/br.html"><span class="kw2">br</span></a> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;name&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;ull_name&quot;</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text&quot;</span> <span class="kw3">size</span><span class="sy0">=</span><span class="st0">&quot;30&quot;</span> <span class="sy0">/</span>&gt;&lt;<a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;required-field&quot;</span>&gt;</span>*<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/td.html"><span class="kw2">td</span></a>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/tr.html"><span class="kw2">tr</span></a>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/tr.html"><span class="kw2">tr</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/td.html"><span class="kw2">td</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp;Website:<br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/br.html"><span class="kw2">br</span></a> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;url&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;website&quot;</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text&quot;</span> <span class="kw3">size</span><span class="sy0">=</span><span class="st0">&quot;30&quot;</span> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/td.html"><span class="kw2">td</span></a>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/tr.html"><span class="kw2">tr</span></a>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/tr.html"><span class="kw2">tr</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/td.html"><span class="kw2">td</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;emailLabel&quot;</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;label&quot;</span>&gt;</span>Email address:<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/br.html"><span class="kw2">br</span></a> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;email&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;email_address&quot;</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text&quot;</span> <span class="kw3">size</span><span class="sy0">=</span><span class="st0">&quot;30&quot;</span> <span class="sy0">/</span>&gt;&lt;<a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;required-field&quot;</span>&gt;</span>*<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/td.html"><span class="kw2">td</span></a>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/tr.html"><span class="kw2">tr</span></a>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/tr.html"><span class="kw2">tr</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/td.html"><span class="kw2">td</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;messageLabel&quot;</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;label&quot;</span>&gt;</span>Message:<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/br.html"><span class="kw2">br</span></a> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/textarea.html"><span class="kw2">textarea</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;message&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;email_message&quot;</span> <span class="kw3">rows</span><span class="sy0">=</span><span class="st0">&quot;5&quot;</span> <span class="kw3">cols</span><span class="sy0">=</span><span class="st0">&quot;40&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/textarea.html"><span class="kw2">textarea</span></a>&gt;&lt;<a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;required-field&quot;</span>&gt;</span>*<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/span.html"><span class="kw2">span</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/td.html"><span class="kw2">td</span></a>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/tr.html"><span class="kw2">tr</span></a>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/tr.html"><span class="kw2">tr</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/td.html"><span class="kw2">td</span></a> <span class="kw3">align</span><span class="sy0">=</span><span class="st0">&quot;center&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/br.html"><span class="kw2">br</span></a> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;submit&quot;</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;button&quot;</span> <span class="kw3">value</span><span class="sy0">=</span><span class="st0">&quot;Submit&quot;</span> <span class="kw3">onclick</span><span class="sy0">=</span><span class="st0">&quot;validateForm()&quot;</span> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/td.html"><span class="kw2">td</span></a>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/tr.html"><span class="kw2">tr</span></a>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/table.html"><span class="kw2">table</span></a>&gt;</span><br />
&nbsp;<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/fieldset.html"><span class="kw2">fieldset</span></a>&gt;</span><br />
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/form.html"><span class="kw2">form</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p>You will notice that the id tag for required fields is different from its name tag. Javascript utilizes the <a href="http://www.tizag.com/javascriptT/javascript-getelementbyid.php" target="_blank" title="Javascript getElementById Tutorial">getDocumentById()</a> method to manipulate the input&#8217;s CSS styling, however, your server-side script will use the name tag to process the data entered.<br />
<br class="clear" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hektorparis.com/javascript-form-validation-before-submit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft is Trashing Your Freedom</title>
		<link>http://www.hektorparis.com/microsoft-is-trashing-your-freedom/</link>
		<comments>http://www.hektorparis.com/microsoft-is-trashing-your-freedom/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 19:11:09 +0000</pubDate>
		<dc:creator>Hektor</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[free software foundation]]></category>
		<category><![CDATA[fsf]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[microsoft is a monopoly]]></category>
		<category><![CDATA[microsoft trash]]></category>
		<category><![CDATA[open office]]></category>
		<category><![CDATA[open source software]]></category>
		<category><![CDATA[windows 7]]></category>
		<category><![CDATA[windows 7 sins]]></category>

		<guid isPermaLink="false">http://www.hektorparis.com/?p=752</guid>
		<description><![CDATA[As Microsoft readies to release yet another version of its monopolistic Windows platform, the FSF has taken on the task of creating a case against Microsoft and it's proprietary software.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-757" title="Windows7Sins.org" src="http://www.hektorparis.com/wp-content/uploads/2009/08/ms_trash.gif" alt="Windows7Sins.org" width="320" height="240" />The <a title="Free Software Foundation" href="http://www.fsf.org/" target="_blank">Free Software Foundation</a> (FSF) has recently launchedÂ  <a title="Windows 7 Sins" href="http://Windows7Sins.org/" target="_blank">Windows7Sins.org</a>, an informative website for computer users, outlining the reasons why Microsoft&#8217;s inferior software products are &#8220;treacherous&#8221; and how they&#8217;re &#8220;trashing&#8221; our freedom as computer users.</p>
<p>As Microsoft readies to release yet another version of its monopolistic Windows platform, the FSF has taken on the task of creating a case against Microsoft and its proprietary software. The case is compelling and thought provoking as it argues against the unethical business tactics employed by Microsoft to own you as a computer user and dictate how you conduct basic functions such as <span id="more-752"></span>update <br class="clear" /><br />software, copy files, purchase computers, interact with other computer users, and manage digital media.</p>
<p>The FSF has <a title="The case against Microsoft and proprietary software" href="http://Windows7Sins.org/letter/" target="_blank">mailed a letter</a> to Fortune 500 companies arguing the reasons why their companies would benefitÂ  ethically, technically and ultimately financially from switching from Microsoft&#8217;s monopoly to open source software solutions such as <a title="Linux" href="http://www.linux.org" target="_blank">Linux</a> and <a title="The Free and Open Productivity Suite" href="http://www.openoffice.org" target="_blank">OpenOffice</a>.</p>
<p><a title="Windows 7 Sins" href="http://Windows7Sins.org/" target="_blank">Click here</a> to read the entire case against Microsoft and proprietary software.<br />
<br class="clear" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hektorparis.com/microsoft-is-trashing-your-freedom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wireless LAN Detection with NetStumbler</title>
		<link>http://www.hektorparis.com/wireless-lan-detection-with-netstumbler/</link>
		<comments>http://www.hektorparis.com/wireless-lan-detection-with-netstumbler/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 06:59:26 +0000</pubDate>
		<dc:creator>Hektor</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[free wireless detector]]></category>
		<category><![CDATA[netstumbler]]></category>
		<category><![CDATA[wifi detection]]></category>
		<category><![CDATA[wifi finder]]></category>
		<category><![CDATA[wifi sniffer]]></category>
		<category><![CDATA[wireless network finder]]></category>
		<category><![CDATA[wireless sniffer]]></category>

		<guid isPermaLink="false">http://www.hektorparis.com/?p=622</guid>
		<description><![CDATA[NetStumbler is a powerful wireless network detection tool available free that can be used for WLAN auditing, WLAN coverage verification, wardriving, antenna positioning and site surveying.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-623" style="border: 0pt none; border-right:1px #CCCCCC solid; border-bottom:1px #CCCCCC solid;" title="wireless-sniffer" src="http://www.hektorparis.com/wp-content/uploads/2009/06/wireless-sniffer.gif" alt="wireless-sniffer" width="320" height="240" /><a title="NetStumbler.com - the home of the award-winning wireless networking tool" href="http://www.netstumbler.com/" target="_blank">NetStumbler</a> is a powerful wireless network detection tool available free that can be used to install or troubleshoot a wireless network. When setting up, configuring or troubleshooting a wireless network, knowing detailed technical information such as possible conflicting channels and service set identifiers (SSIDs), can help you complete the job properly and more securely. NetStumbler uses <a title="IEEE 802.11" href="http://en.wikipedia.org/wiki/802.11" target="_blank">802.11 a,b,g</a> networking standards, it is compatible with most wireless LAN adapters and runs on Windows 2000, Windows XP or better. Possible applications for NetStumbler include WLAN auditing, WLAN coverage verification, wardriving, antenna positioning and site surveying. <span id="more-622"></span><br />
<br class="clear" /></p>
<p><strong>Antenna Positioning</strong> &#8211; When installing an antenna use NetStumbler to assist you in positioning and aiming the antenna to get the best coverage possible.</p>
<p><strong>Site Survey</strong> &#8211; When installing or troubleshooting a wireless LAN, it is important to pick  locations and channels in such a way that interference is minimized. A site  survey typically includes finding out what existing items (microwave ovens,  cordless phones, radio hams) are using the radio frequencies as the wireless  LAN. A survey should done before installation of a new wireless LAN, and then  subsequent surveys should be performed after installation. A full site survey  requires special hardware such as an RF spectrum analyzer, but NetStumbler can  also be used as part of a site survey.</p>
<p><strong>Wardriving</strong> &#8211; Detect wireless LANs while moving, walking or in a vehicle, using a laptop or PDA (use of a GPS receiver is highly recommended).</p>
<p><strong>Wireless Coverage Verification -</strong> Use NetStumbler to verify signal quality as well as extended coverage beyond the intended area.</p>
<p><strong>Wireless LAN Auditing &#8211; </strong>Securing a wireless LAN from unauthorized or &#8220;rogue&#8221; access points setup independently by network users is a task common to network administrators. Using a laptop and walking around the office, an audit can be performed using NetStumbler to detect the presence of a risky exposure to the wireless LAN.</p>
<p><strong><br />
</strong></p>
<p><strong>NetStumbler&#8217;s List View</strong></p>
<p>The list view contains an item for each <a title="BSSID definition" href="http://reviews.cnet.com/4520-6029_7-5818827-1.html" target="_blank">BSSID</a> detected. A large amount of information is presented in the columns.</p>
<table id="Table1" border="1" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td><strong>Column</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>MAC</td>
<td>The text contains the <a title="BSSID definition" href="http://reviews.cnet.com/4520-6029_7-5818827-1.html" target="_blank">BSSID</a> for wireless devices. The icon shows the signal strength as reported in the last scan: Gray means the item was not detected, or a colored icon ranging from red to green reports the signal strength. A lock appears in the icon if encryption is enabled on the network. For devices on a wired network segment, the iconÂ shows a T-shaped network cable and the <a title="MAC address definition" href="http://www.webopedia.com/TERM/M/MAC_address.html" target="_blank">MAC address</a> is displayed.</td>
</tr>
<tr>
<td>SSID</td>
<td>The reported <a title="SSID definition" href="http://www.webopedia.com/TERM/S/SSID.html" target="_blank">SSID</a>. This may be blank for access points that report their existence but not their SSID. For wired network items, the SSID is assumed to be the SSID that was associated when the item was discovered.</td>
</tr>
<tr>
<td>Name</td>
<td>The device&#8217;s name. This is reported rarely and only if &#8220;Query APs for names&#8221; is configured.</td>
</tr>
<tr>
<td>Chan</td>
<td>All the <a title="Wireless Channel definition" href="http://compnetworking.about.com/od/wifihomenetworking/qt/wifichannel.htm" target="_blank">channels</a> that the device has been seen on. The most recent one is listed first. Before the channel number may be a star (*), which means you are associated with the device, or a plus (+) which means that you were associated with it at some point.</td>
</tr>
<tr>
<td>Speed</td>
<td>The maximum reported <a title="Bandwidth definition" href="http://www.webopedia.com/TERM/b/bandwidth.html" target="_blank">bandwidth</a> for the device (this is not the actual bandwidth). If you are using an 802.11b device, it may misreport the bandwidth of 802.11g networks as 11Mbps. Some devices are capable of 108Mbps but only report 54Mbps.</td>
</tr>
<tr>
<td>Vendor</td>
<td>The vendorÂ assigned toÂ the MAC, which may not be the actual equipment manufacturer.</td>
</tr>
<tr>
<td>Type</td>
<td>&#8220;<a title="Access Point definition" href="http://www.webopedia.com/TERM/A/AP.html" target="_blank">AP</a>&#8221; for a <a title="Basic Service Set definition" href="http://www.webopedia.com/TERM/B/Basic_Service_Set.html" target="_blank">BSS</a>, &#8220;Peer&#8221; for an <a title="Ad Hoc definition" href="http://www.webopedia.com/TERM/A/ad_hoc_mode.html" target="_blank">IBSS</a>.</td>
</tr>
<tr>
<td>Encryption</td>
<td>The word &#8220;<a title="Web Equivalent Protection definition" href="http://www.webopedia.com/TERM/W/WEP.html" target="_blank">WEP</a>&#8221; will appear on an encrypted network, regardless of whether it is really using WEP.</td>
</tr>
<tr>
<td>SNR</td>
<td>The current <a title="WiFi Signal definition" href="http://compnetworking.about.com/od/wirelessfaqs/f/signal_strength.htm" target="_blank">Signal</a> to Noise ratio, either in <a title="Decibel" href="http://en.wikipedia.org/wiki/Decibel" target="_blank">dB</a> or arbitrary <a title="RSSI definition" href="http://en.wikipedia.org/wiki/Received_Signal_Strength_Indication" target="_blank">RSSI</a> units.</td>
</tr>
<tr>
<td>Signal+</td>
<td>The highest seen Signal value.</td>
</tr>
<tr>
<td>Noise-</td>
<td>The lowest seen Noise value.</td>
</tr>
<tr>
<td>SNR+</td>
<td>The highest seen SNR value.</td>
</tr>
<tr>
<td>IP, Subnet</td>
<td>The <a title="Internet Protocol definition" href="http://www.webopedia.com/TERM/I/IP.html" target="_blank">IP</a> configuration of the object, if available.</td>
</tr>
<tr>
<td>Latitude, Longitude, Distance</td>
<td>If you are using a GPS receiver, this indicates the estimated position of the object. This position is currently the location where the strongest signal was seen, which is never the actual location. Distance is measured from your current position to the object&#8217;s estimated position.</td>
</tr>
<tr>
<td>First Seen</td>
<td>The time or date when the object was first discovered.</td>
</tr>
<tr>
<td>Last Seen</td>
<td>The most recent time or date when the object was seen.</td>
</tr>
<tr>
<td>Signal</td>
<td>The current Signal level, either in dB or arbitrary RSSI units.</td>
</tr>
<tr>
<td>Noise</td>
<td>The current Noise level, in dB. Not supported by all devices.</td>
</tr>
<tr>
<td>Flags</td>
<td>The 802.11 capability flags, in hexadecimal.</td>
</tr>
<tr>
<td>Beacon</td>
<td>The 802.11 beacon interval, in KÂµs.</td>
</tr>
</tbody>
</table>
<p><br class="clear" /></p>
<p><strong>NetStumbler Video &#8211; </strong>Watch this video by <a title="Netstumbler (Part 1)" href="http://www.securitytube.net/Netstumbler-(Part-1)-video.aspx" target="_blank">SecurityTube</a> to learn more about how NetStumbler works.<br />
<br class="clear" /><br />
<object width="550" height="500" data="http://videos.securitytube.net/main.swf" type="application/x-shockwave-flash"><param name="allowScriptAccess" value="always" /><param name="FlashVars" value="video=Netstumbler (Part 1)" /><param name="wmode" value="transparent" /><param name="src" value="http://videos.securitytube.net/main.swf" /><param name="flashvars" value="video=Netstumbler (Part 1)" /></object></p>
<p><a title="Download NetStumbler" href="http://www.netstumbler.com/downloads/" target="_blank"><strong>Download NetStumbler</strong></a><br />
<br class="clear" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hektorparis.com/wireless-lan-detection-with-netstumbler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Resize Multiple Images at Once</title>
		<link>http://www.hektorparis.com/resize-multiple-images-at-once-using-photoshop/</link>
		<comments>http://www.hektorparis.com/resize-multiple-images-at-once-using-photoshop/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 02:26:21 +0000</pubDate>
		<dc:creator>Hektor</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[photoshop image actions]]></category>
		<category><![CDATA[photoshop image processor]]></category>
		<category><![CDATA[photoshop image resize]]></category>
		<category><![CDATA[photoshop resize multiple images at once]]></category>
		<category><![CDATA[resize multiple images]]></category>
		<category><![CDATA[resize multiple images in photoshop]]></category>

		<guid isPermaLink="false">http://www.hektorparis.com/?p=591</guid>
		<description><![CDATA[Using custom Actions and Image Processor in Photoshop CS3 you can automate image resizing to save time.]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-592 alignleft" style="border: 0pt none; border-right:1px #CCCCCC solid; border-bottom:1px #CCCCCC solid;" title="Image Size in Photoshop CS3" src="http://www.hektorparis.com/wp-content/uploads/2009/06/photoshop-resize.gif" alt="Image Size in Photoshop CS3" width="320" height="240" />Using custom Actions and Image Processor in Photoshop CS3 you can automate image resizing to save time.</p>
<p>In this tutorial you will see how easy it is to create an Action in Photoshop to resize multiple images and even apply filters.</p>
<p><span id="more-591"></span><br />
<br style="clear:all; clear:left;" /></p>
<p><strong>Before you begin</strong><br />
Please note that to automate image resizing, all your &#8220;raw&#8221; images have to be the same dimension, meaning width and height is the same for all files to be processed. Pixel dimensions are proportionate to the image size of the input file and any variation in dimensions may output an undesirable distorted new image.</p>
<p><strong>About Actions<br />
</strong></p>
<p><a title="About actions" href="http://livedocs.adobe.com/en_US/Photoshop/10.0/help.html?content=WSB2434464-4A8C-410e-9757-A74A065FA9E6.html" target="_blank">Actions in Photoshop</a> are a sequence of steps which you record one by one as you edit an image. An <dfn class="term">action</dfn> can then be played back on a  single file or a batch of files to applyâ€”menu commands, palette options, tool actions,  and so on. You can record, edit, customize, and batch-process actions, and you can manage  groups of actions by working with action sets.</p>
<p><strong>About Image Processor</strong></p>
<p><a title="Convert files with the Image Processor" href="http://livedocs.adobe.com/en_US/Photoshop/10.0/help.html?content=WSfd1234e1c4b69f30ea53e41001031ab64-7426.html" target="_blank">Image Processor in Photoshop</a> converts and processes multiple files. You can do any of the following in the Image Processor:</p>
<p>- Convert a set of files to either JPEG, PSD, or TIFF format; or convert files  simultaneously to all three formats.<br />
- Process a set of camera raw files using the same options.<br />
- Resize images to fit within specified pixel dimensions.<br />
- Embed a color profile or convert a set of files to sRGB and save them as JPEG  images for the web.<br />
- Include copyright metadata into the converted images.<br />
- Works with Photoshop (PSD), JPEG, and camera raw files.</p>
<p><strong>Let&#8217;s begin!</strong></p>
<p>Organize the image files to be resized by placing them in a &#8220;source&#8221; folder if you havent&#8217; already done so. Launch Photoshop then go to:</p>
<p><strong>Window</strong>-&gt;<strong>Actions</strong> or use keyboard shortcut Alt+F9</p>
<p><img class="alignleft size-full wp-image-599" title="Show Actions" src="http://www.hektorparis.com/wp-content/uploads/2009/06/photoshop-view-actions.gif" alt="Show Actions" width="460" height="191" /></p>
<p><br style="clear:all; clear:left;" /><br />
This will activate the Actions palette in your Workspace so you can begin building an Action.</p>
<p>Click <strong>Create New Action</strong> from the Action palette and give it an unique name that describes the purpose of this Action.</p>
<p><img class="alignleft size-full wp-image-600" style="border: 0pt none;" title="Create new action" src="http://www.hektorparis.com/wp-content/uploads/2009/06/photoshop-new-action.gif" alt="Create new action" width="212" height="131" /><br />
<br style="clear:all; clear:left;" /></p>
<p><img class="alignleft size-full wp-image-601" style="border: 0pt none;" title="Create Action" src="http://www.hektorparis.com/wp-content/uploads/2009/06/photoshop-create-action.gif" alt="Create Action" width="382" height="153" /><br />
<br style="clear:all; clear:left;" /></p>
<p>This will create an Action set under the <em>Default Actions</em> folder of the Actions palette.</p>
<p><img class="alignleft size-full wp-image-602" style="border: 0pt none;" title="Photoshop Action" src="http://www.hektorparis.com/wp-content/uploads/2009/06/photoshop-action.gif" alt="Photoshop Action" width="291" height="226" /><br />
<br style="clear:all; clear:left;" /><br />
Next, open a &#8220;raw&#8221; sample image from your &#8220;source&#8221; folder and from the Actions palette, click <strong>Record</strong></p>
<p><img class="alignleft size-full wp-image-603" style="border: 0pt none;" title="Record Action" src="http://www.hektorparis.com/wp-content/uploads/2009/06/photoshop-action-record.gif" alt="Record Action" width="293" height="235" /><br />
<br style="clear:all; clear:left;" /><br />
As the name implies, the <strong>Record</strong> function will create a <em>record</em> of all operations performed on the image you&#8217;ve opened. It is this set of &#8220;steps&#8221; in form of an <em>action</em> that will be used by Image Processor to resize your images. Next, go to the <strong>Image</strong> menu and click <strong>Image Size</strong>, specify the desired <em>Width</em> and <em>Height</em> and click <strong>OK</strong></p>
<p><img class="alignleft size-full wp-image-606" style="border: 0pt none; border-right:1px #CCCCCC solid; border-bottom:1px #CCCCCC solid;" title="Image Size menu" src="http://www.hektorparis.com/wp-content/uploads/2009/06/photoshop-image-size-menu.jpg" alt="Image Size menu" width="500" height="374" /><br />
<br style="clear:all; clear:left;" /><br />
<img class="alignleft size-full wp-image-607" style="border: 0pt none;" title="Image Size window" src="http://www.hektorparis.com/wp-content/uploads/2009/06/photoshop-image-size-window.jpg" alt="Image Size window" width="406" height="353" /><br />
<br style="clear:all; clear:left;" /><br />
If you would like to apply any filters, click the <strong>Filter</strong> menu and proceed to edit the image knowing that any <em>filters</em> you use will be <em>recorded</em> and applied to subsequent images. After you finish editing the image, click <strong>Stop</strong> from <strong>Actions</strong> palette to halt further recording of operations. <strong>Close</strong> the image without saving any changes.</p>
<p><img class="alignleft size-full wp-image-608" style="border: 0pt none;" title="Stop Action" src="http://www.hektorparis.com/wp-content/uploads/2009/06/photoshop-stop-action.gif" alt="Stop Action" width="291" height="234" /><br />
<br style="clear:all; clear:left;" /><br />
Go to <strong>File</strong>-&gt;<strong>Scripts</strong>-&gt;<strong>Image Processor&#8230;</strong></p>
<p><img class="alignleft size-full wp-image-609" title="Scripts Menu" src="http://www.hektorparis.com/wp-content/uploads/2009/06/photoshop-scripts-menu.gif" alt="Scripts Menu" width="688" height="637" /><br />
<br style="clear:all; clear:left;" /><br />
From the <strong>Image Processor</strong> window in step <strong>1</strong> click <em>Select Folder&#8230;</em> to specify the source folder containing the &#8220;raw&#8221; images to be processed. In step <strong>2 </strong>click the second radio button to activate and click the <em>Select Folder&#8230; </em>button to specify the destination folder for your resized images. Next,<strong> </strong>in step <strong>3</strong> select the output <em>File Type</em> for your images. In this example I am saving all images as JPG with a high quality of 11 (maximum quality is 12). Finally, click the <strong>Run Action</strong> checkbox and from the second dropdown menu adjacent to <em>Default Actions</em> select the name of the <strong>Action</strong> you created earlier. Begin the automation process by clicking <strong>Run</strong>.</p>
<p><img class="alignleft size-full wp-image-611" style="border: 0pt none;" title="Image Processor window" src="http://www.hektorparis.com/wp-content/uploads/2009/06/photoshop-image-processor-window.gif" alt="Image Processor window" width="574" height="593" /><br />
<br style="clear:all; clear:left;" /><br />
Photoshop will now apply the set of <em>Actions</em> you&#8217;ve recorded in form of <strong>Image Resize </strong>and <strong>Filters</strong> (if any) to your &#8220;source&#8221; folder images and output JPGs to your specified &#8220;destination&#8221; folder, leaving the originals untouched.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hektorparis.com/resize-multiple-images-at-once-using-photoshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Botticelli&#8217;s La Primavera</title>
		<link>http://www.hektorparis.com/botticellis-la-primavera/</link>
		<comments>http://www.hektorparis.com/botticellis-la-primavera/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 06:06:00 +0000</pubDate>
		<dc:creator>Hektor</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[botticelli la primavera]]></category>
		<category><![CDATA[botticelli's la primavera]]></category>

		<guid isPermaLink="false">http://www.hektorparis.com/?p=560</guid>
		<description><![CDATA[La Primavera (c. 1482), an Early Renaissance masterwork by Sandro Botticelli, is a captivating illustration of Greek mythology icons that restarted my interest in the ancient Greek and Roman legends.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-562" title="Botticelli's La Primavera" src="http://www.hektorparis.com/wp-content/uploads/2009/05/botticelli-primavera1.jpg" alt="Botticelli's La Primavera" width="320" height="227" /><em>La Primavera</em> (c. 1482), an Early Renaissance masterpiece by <a title="WebMuseum: Botticelli, Sandro" href="http://www.ibiblio.org/wm/paint/auth/botticelli/" target="_blank">Sandro Botticelli</a>, is a captivating illustration of <a title="The Theoi Project, a site exploring Greek mythology and the gods in classical literature and art." href="http://www.theoi.com/" target="_blank">Greek mythology</a> icons that restarted my interest in the ancient Greek and Roman legends. I was fortunate enough to receive a canvas print of <em>La Primavera</em> from <a title="About Eddie Shabot" href="http://www.tatootbags.com/about.php?category=info&amp;page=about_us" target="_blank">Eddie Shabot</a>, owner of <a title="ArtMaster Galleri Canvas and Framed Art" href="http://www.tatootbrand.com" target="_blank">ArtMaster Galleri</a> and co-founder of <a title="Tatoot Graffiti Blog" href="http://www.tatoot.com/blog/" target="_blank">Tatoot</a>.</p>
<p>Born Alessandro Di Mariano Filipepi in 1445 Florance, Italy; Botticelli or Il Botticelli (&#8220;The Little Barrel&#8221;) was an Early Renaissance artist whose resume includes portraits for the powerful Medici family and wall frescoes in the Sistine Chapel of the Vatican. <span id="more-560"></span></p>
<p><br class="clear:left;" /></p>
<p>Botticelli&#8217;s most famous masterpieces though are <em>La Primavera</em> and <em>The Birth of Venus</em> (c. 1485). They are among the most recognizable paintings of Florentine art.</p>
<p><strong>La Primavera</strong></p>
<p style="text-align: center;"><img class="size-full wp-image-571 aligncenter" title="Hermes and the Three Graces in Botticelli's La Primavera" src="http://www.hektorparis.com/wp-content/uploads/2009/05/primavera-hermes-three-graces.jpg" alt="Hermes and the Three Graces in Botticelli's La Primavera" width="595" height="445" /></p>
<p><br style="clear:left;" /></p>
<p>Housed at the Uffizi Gallery of Florence in Italy, <em>La Primavera</em> (spring in Italian) is a tempera painting (measuring 80&#8243; x 124&#8243;) that is assumed to have been painted for <a href="http://en.wikipedia.org/wiki/Lorenzo_di_Pierfrancesco_de%27_Medici" target="_blank">Lorenzo di Pierfrancesco de&#8217; Medici</a> c.1482. <em>La Primavera</em> masterfully illustrates in life-size the gathering of key Greek mythology gods in a Garden of Eden type scenario, that is open to interpretation.</p>
<p><a title="Hermes: Greek god of herds, trades and athletics, Herold of the Gods" href="http://www.theoi.com/Olympios/Hermes.html" target="_blank">Hermes</a>, god of fortune and messenger to Zeus, stands in the far-left holding his caduceus with which he impedes a god of wind from hovering above the gathering. The <a title="The Three Graces: Greek goddesses of pleasure and joy" href="http://www.theoi.com/Ouranios/Kharites.html" target="_blank">Three Graces</a> who are goddesses of grace, beauty and joy, stand next to Hermes while holding hands and dancing in a circle.</p>
<p><br class="clear:left;" /></p>
<p><img class="size-full wp-image-578 alignleft" title="Cupid, Venus, Chloe and Zephyrus" src="http://www.hektorparis.com/wp-content/uploads/2009/05/primavera-cupid-venus-chloe-zephyrus.jpg" alt="Cupid, Venus, Chloe and Zephyrus" width="590" height="445" /></p>
<p><br style="clear:left;" /></p>
<p><a title="Eros: Greek god of love" href="http://www.theoi.com/Ouranios/Eros.html" target="_blank">Eros</a>, god of love, is center-top depicted as a plump infant (though he is sometimes shown as a handsome youth) holding his bow and arrow. Below Eros is <a title="Aphrodite: Greek goddess of beauty" href="http://www.theoi.com/Olympios/Aphrodite.html" target="_blank">Aphrodite</a>, goddess of beauty, shown in full dress as opposed to being nude which is how she is typically illustrated, as is the case with Botticelli&#8217;s <a title="Botticelli's The Birth of Venus" href="http://studiofoundationsspring2008.blogspot.com/2008/03/serena-ho-botticellis-birth-of-venus.html" target="_blank"><em>The Birth of Venus</em></a>. Adjacent to Aphrodite is <a title="Flora: Greek goddess of spring and flowers" href="http://en.wikipedia.org/wiki/Flora_(goddess)" target="_blank">Flora</a>, goddess of flowers and the season of spring, wearing an elaborate dress decorated with flowers. Next to last is the Nymph <a title="Greek mythology: Nymph Chloris" href="http://en.wikipedia.org/wiki/Chloris" target="_blank">Chloris</a> who is associated with spring, flowers and new growth, trying to avoid being kidnapped by <a title="Zephyros: Greek god of the west wind" href="http://www.theoi.com/Titan/AnemosZephyros.html" target="_blank">Zephyros</a>, god of the west wind.</p>
<p><a title="Botticelli's La Primavera (high resolution)" href="http://www.hektorparis.com/wp-content/uploads/2009/05/botticelli-primavera.jpg" target="_blank">Download high resolution (2000&#215;1419 pixels)</a></p>
<p><strong>Botticelli&#8217;s <em>La Primavera</em>: Myths or Fingerprints?</strong></p>
<p>I found this <a title="AccountOfTheSun" href="http://www.youtube.com/user/AccountOfTheSun" target="_blank">YouTube</a> video in whichÂ  Gombrich, Hope, Dempsey and others explore the meaning and provenance of Botticelli&#8217;s <em>La Primavera.</em> Enjoy!</p>
<p style="text-align:center;"><object width="590" height="486" data="http://www.youtube.com/v/ZW0E25fu9J4" type="application/x-shockwave-flash"><param name="quality" value="high" /><param name="name" value="Botticelli's La Primavera " /><param name="src" value="http://www.youtube.com/v/ZW0E25fu9J4" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hektorparis.com/botticellis-la-primavera/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dell Latitude E5500 Impression</title>
		<link>http://www.hektorparis.com/dell-latitude-e5500-impression/</link>
		<comments>http://www.hektorparis.com/dell-latitude-e5500-impression/#comments</comments>
		<pubDate>Thu, 28 May 2009 06:52:54 +0000</pubDate>
		<dc:creator>Hektor</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[dell e5500 user reviews]]></category>
		<category><![CDATA[dell latitude e5500]]></category>

		<guid isPermaLink="false">http://www.hektorparis.com/?p=542</guid>
		<description><![CDATA[The Dell Latitude E5500 is a functional, stylish and budget-friendly laptop great for everyday practical use. A corporate class laptop designed and engineered for mobility, performance and reliability while maintaining essential features such as portability, battery life and commonality.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-544" title="latitude-e5500-hi-res" src="http://www.hektorparis.com/wp-content/uploads/2009/05/latitude-e5500.jpg" alt="My Dell Latitude E5500" width="320" height="351" />The <a href="http://www.dell.com/content/products/productdetails.aspx/laptop_latitude_e5500?c=us&#038;l=en&#038;s=bsd" target="_blank">Dell Latitude E5500</a> is a functional, stylish and budget-friendly laptop great for everyday practical use. Dell Latitude computers areÂ corporate class laptopsÂ designed and engineered for mobility, performance and reliability while maintaining essential features such as portability, battery life and commonality.</p>
<p>I am a repeat customer of the Dell brand, especially the Latitude family, for the simple reason that even the most economical Latitude laptop is well-equipped to perform daily tasks such as Internet, email, photo editing, web development, multimedia and more. </p>
<p>The design of this model laptop is appealing because, in the case of my E5500, the black body frame is esthetically pleasing, the keyboard layout is practical and it&#8217;s not too different from my old C840 (R.I.P), computer ports are conveniently located so they can be easily accessed from either side without <span id="more-542"></span>having to reach behind the LCD.<br />
<br clear="left" /><br />
Another noticeable improvement in the E5500 is that it befits the definition of a laptop, meaning you can place it on your lap for an extended period of time without it burning you. Better heat dissipation is complimented by a decrease in weight, compared to my C840 which weighed nearly 10 lbs, my configuration is about 4 lbs lighter.</p>
<p>If I could change anything about the E5500, I would improve the clonky keyboard, Â offer Ambient sensor software for Windows XP, cover up the dock port at the base to protect it from shit gettin&#8217; all up in there, upgrade to an UltraSharp LCD and install better speakers.</p>
<p><b>My Dell Latitude E5500</b></p>
<p><b>Processor:</b>	Intel Core 2 Duo P8600 (2.40GHz, 3M L2 Cache, 1066MHz FSB)<br />
<b>Operating System:</b>	Microsoft Windows XP Professional<br />
<b>BIOS Version/Date:</b>	A11, 4/15/2009<br />
<b>Hard Drive:</b>	80GB, 5400 RPM, 9.5 WD-ML160<br />
<b>LCD:</b>		15.4 inch Wide Screen WXGA+ Anti-glare LCD Panel<br />
<b>Graphics:</b>	Mobile IntelÂ® Graphics Media Accelerator 4500MHD<br />
<b>Memory:</b>	2.0GB, DDR2-800 SDRAM, 1 DIMM<br />
<b>Optical Device:</b>	24X CD-RW/DVD w/ Cyberlink PowerDVD<br />
<b>Wireless LAN:</b>	Dell Wireless 1397 802.11b/g Mini Card<br />
<b>Battery:</b>		6 Cell Battery<br />
<b>AC Adapter:</b>	90W A/C Adapter (3-pin)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hektorparis.com/dell-latitude-e5500-impression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upload Multiple Images at Once using PHP</title>
		<link>http://www.hektorparis.com/upload-multiple-images-at-once-using-php/</link>
		<comments>http://www.hektorparis.com/upload-multiple-images-at-once-using-php/#comments</comments>
		<pubDate>Tue, 26 May 2009 01:12:41 +0000</pubDate>
		<dc:creator>Hektor</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ajax file upload]]></category>
		<category><![CDATA[ajax multiple file upload]]></category>
		<category><![CDATA[fancyupload]]></category>
		<category><![CDATA[file input]]></category>
		<category><![CDATA[file uploader]]></category>
		<category><![CDATA[multiple-file upload php]]></category>
		<category><![CDATA[php file uploader]]></category>
		<category><![CDATA[php upload files]]></category>
		<category><![CDATA[php upload images]]></category>
		<category><![CDATA[php upload multiple files]]></category>
		<category><![CDATA[upload images with php]]></category>

		<guid isPermaLink="false">http://www.hektorparis.com/?p=497</guid>
		<description><![CDATA[Using PHP and FancyUpload you can select multiple files to upload at once. FancyUpload is a powerful and elegant Ajax file uploading script that is easy to configure.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-500" title="PHP and FancyUpload" src="http://www.hektorparis.com/wp-content/uploads/2009/05/php-fancy-upload.jpg" alt="PHP and FancyUpload" width="320" height="240" />Using PHP and <a title="FancyUpload - Swiff meets Ajax" href="http://digitarald.de/project/fancyupload/" target="_blank">FancyUpload</a> you can select multiple files to upload at once. FancyUpload is a powerful and elegant Ajax file uploading script that is easy to setup and configure. What makes FancyUpload attractive to use for uploading files is that it&#8217;s server independent and completely styliable using CSS and XHTML, plus it uses <a href="http://mootools.net/" target="_blank">MooTools</a> to function across modern browsers.</p>
<p>The purpose of this tutorial is to show you how to use FancyUpload for uploading multiple <u>images</u> at once using PHP. Please note that FancyUpload is able to upload other file types as well. I recommend you <a href="http://digitarald.de/project/fancyupload/#showcases" target="_blank" title="FancyUpload Showcases">visit</a> their website to see other showcases. <span id="more-497"></span></p>
<p><br clear="left" /><br />
<b>About PHP File Upload</b><br />
When posting form inputs of &#8220;file&#8221; type, PHP uses the global $_FILES array to upload a file from a client computer to the remote server. The $_FILES array contains the following parameters:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st0">&quot;file&quot;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&quot;tmp_name&quot;</span><span class="br0">&#93;</span> <span class="co1">// A temporary name designated by the server</span><br />
<span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st0">&quot;file&quot;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&quot;name&quot;</span><span class="br0">&#93;</span> <span class="co1">// Original filename</span><br />
<span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st0">&quot;file&quot;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&quot;type&quot;</span><span class="br0">&#93;</span> <span class="co1">// Mime-type, in this case &quot;image-type&quot;</span><br />
<span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st0">&quot;file&quot;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&quot;size&quot;</span><span class="br0">&#93;</span> <span class="co1">// File size in bytes</span><br />
<span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st0">&quot;file&quot;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&quot;error&quot;</span><span class="br0">&#93;</span> <span class="co1">// Error code information about failed upload</span></div></td></tr></tbody></table></div>
<p><br clear="all" /><br />
<b>File Upload and Security</b><br />
It is important to use an upload mechanism that prevents malicious users from performing any unauthorized task. The code below uses the <a href="http://www.php.net/manual/en/function.move-uploaded-file.php" target="_blank">move_uploaded_file($filename, $destination)</a> function to ensure that the file designated by $filename  is a valid upload file (meaning that it was uploaded via PHP&#8217;s HTTP POST upload mechanism).</p>
<p>If the file is valid, it will be moved to the $filename given by the $destination parameter. However,  if $filename  is not a valid upload file, then no action will occur, and move_uploaded_file() will return FALSE. If $filename is a valid upload file, but cannot be moved for some reason, no action will occur, and move_uploaded_file() will return FALSE. Additionally, a warning will be issued. </p>
<p>This sort of check is especially important if there is any chance that anything done with uploaded files could reveal their contents to the user, or even to other users on the same system.</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="coMULTI">/***BOF FILE UPLOAD***/</span><br />
<br />
<span class="co1">// Check that the images directory exists</span><br />
<span class="kw1">if</span><span class="br0">&#40;</span><a href="http://www.php.net/file_exists"><span class="kw3">file_exists</span></a><span class="br0">&#40;</span><span class="re0">$upload_directory</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">// Upload file or return error message information</span><br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span><a href="http://www.php.net/move_uploaded_file"><span class="kw3">move_uploaded_file</span></a><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'Filedata'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'tmp_name'</span><span class="br0">&#93;</span><span class="sy0">,</span> <span class="re0">$upload_directory</span> <span class="sy0">.</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'Filedata'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'name'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$error</span> &nbsp;<span class="sy0">=</span> <span class="st0">&quot;Could not upload file &quot;</span> <span class="sy0">.</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st0">&quot;Filedata&quot;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&quot;name&quot;</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st0">&quot;&lt;br /&gt;&quot;</span> <span class="sy0">.</span><span class="re0">$_FILES</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span class="coMULTI">/***EOF FILE UPLOAD***/</span></div></td></tr></tbody></table></div>
<p><br clear="all" /><br />
<b>Before you Begin</b><br />
<a href="http://github.com/digitarald/digitarald-fancyupload/tree/master" target="_blank" title="Download UploadFancy">Download</a> the complete ActionScript and JavaScript source files, documentation and showcases from the FancyUpload website. The source code below is part of the &#8220;Photo Queue&#8221; showcase which is intended for uploading images only by restricting the file type.</p>
<p>Using <a href="http://filezilla-project.org/" target="_blank">FileZilla</a> or your favorite FTP client, upload the decompressed &#8220;fancyupload&#8221; directory to your web server. Next, create a directory where you want to upload images and assign it file permissions 777. Now let&#8217;s begin!</p>
<p><b>FancyUpload version 3.0 features:</b><br />
- Ability to select multiple files to upload at once<br />
- Filter file by type<br />
- A lot of possible Events to add your own behaviour<br />
- Show and filter useful file information before the upload starts<br />
- Limit uploads by file count, type or size<br />
- Platform and server independent, just needs Flash 9+ (> 95% penetration)<br />
- Graceful Degradation, since the element is replaced after the Flash is loaded successfully<br />
- Cancel running uploads, add files during upload<br />
- Everything is optional, documented and easy editable</p>
<p><b>Compatibility</b><br />
Fully compatible with all A-Grade Browsers (Internet Explorer 6+, Opera 9, Firefox 1.5+ and Safari 3+) with Adobe Flash 9 and 10 player.<br />
<br clear="all" /><br />
<b>Source Files:</b></p>
<p><b>CSS Stylesheet</b><br />
<a href="http://www.hektorparis.com/hp-lab/fancyupload/showcase/photoqueue/style.css" target="_blank">/fancyupload/showcase/<b>photoqueue</b>/style.css</a></p>
<div class="codecolorer-container css mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br /></div></td><td><div class="css codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="coMULTI">/**<br />
&nbsp;* FancyUpload Showcase<br />
&nbsp;*<br />
&nbsp;* @license &nbsp; &nbsp; MIT License<br />
&nbsp;* @author&nbsp; &nbsp; &nbsp; Harald Kirschner &lt;mail [at] digitarald [dot] de&gt;<br />
&nbsp;* @copyright &nbsp; Authors<br />
&nbsp;*/</span><br />
&nbsp;<br />
<span class="coMULTI">/* CSS vs. Adblock tabs */</span><br />
<span class="re1">.swiff-uploader-box</span> a <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">display</span><span class="sy0">:</span> <span class="kw2">none</span> !important<span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
&nbsp;<br />
<span class="coMULTI">/* .hover simulates the flash interactions */</span><br />
a<span class="re2">:hover</span><span class="sy0">,</span> a<span class="re1">.hover</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">color</span><span class="sy0">:</span> <span class="kw2">red</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
&nbsp;<br />
<span class="re0">#demo-status</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">padding</span><span class="sy0">:</span> <span class="re3">10px</span> <span class="re3">15px</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">width</span><span class="sy0">:</span> <span class="re3">420px</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">border</span><span class="sy0">:</span> <span class="re3">1px</span> <span class="kw2">solid</span> <span class="re0">#eee</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
&nbsp;<br />
<span class="re0">#demo-status</span> <span class="re1">.progress</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">background</span><span class="sy0">:</span> <span class="kw2">url</span><span class="br0">&#40;</span><span class="co2">../../assets/progress-bar/progress.gif</span><span class="br0">&#41;</span> <span class="kw2">no-repeat</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">background-position</span><span class="sy0">:</span> <span class="re3">+<span class="nu0">50</span>%</span> <span class="nu0">0</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">margin-right</span><span class="sy0">:</span> <span class="re3">0.5em</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">vertical-align</span><span class="sy0">:</span> <span class="kw2">middle</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
&nbsp;<br />
<span class="re0">#demo-status</span> <span class="re1">.progress-text</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">font-size</span><span class="sy0">:</span> <span class="re3">0.9em</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">font-weight</span><span class="sy0">:</span> <span class="kw2">bold</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
&nbsp;<br />
<span class="re0">#demo-list</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">list-style</span><span class="sy0">:</span> <span class="kw2">none</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">width</span><span class="sy0">:</span> <span class="re3">450px</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">margin</span><span class="sy0">:</span> <span class="nu0">0</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
&nbsp;<br />
<span class="re0">#demo-list</span> li<span class="re1">.validation-error</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">padding-left</span><span class="sy0">:</span> <span class="re3">44px</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">display</span><span class="sy0">:</span> <span class="kw2">block</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">clear</span><span class="sy0">:</span> <span class="kw1">left</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">line-height</span><span class="sy0">:</span> <span class="re3">40px</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">color</span><span class="sy0">:</span> <span class="re0">#8a1f11</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">cursor</span><span class="sy0">:</span> <span class="kw2">pointer</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">border-bottom</span><span class="sy0">:</span> <span class="re3">1px</span> <span class="kw2">solid</span> <span class="re0">#fbc2c4</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">background</span><span class="sy0">:</span> <span class="re0">#fbe3e4</span> <span class="kw2">url</span><span class="br0">&#40;</span><span class="co2">assets/failed.png</span><span class="br0">&#41;</span> <span class="kw2">no-repeat</span> <span class="re3">4px</span> <span class="re3">4px</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
&nbsp;<br />
<span class="re0">#demo-list</span> li<span class="re1">.file</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">border-bottom</span><span class="sy0">:</span> <span class="re3">1px</span> <span class="kw2">solid</span> <span class="re0">#eee</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">background</span><span class="sy0">:</span> <span class="kw2">url</span><span class="br0">&#40;</span><span class="co2">assets/file.png</span><span class="br0">&#41;</span> <span class="kw2">no-repeat</span> <span class="re3">4px</span> <span class="re3">4px</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">overflow</span><span class="sy0">:</span> <span class="kw2">auto</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="re0">#demo-list</span> li<span class="re1">.file</span><span class="re1">.file-uploading</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">background-image</span><span class="sy0">:</span> <span class="kw2">url</span><span class="br0">&#40;</span><span class="co2">assets/uploading.png</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">background-color</span><span class="sy0">:</span> <span class="re0">#D9DDE9</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="re0">#demo-list</span> li<span class="re1">.file</span><span class="re1">.file-success</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">background-image</span><span class="sy0">:</span> <span class="kw2">url</span><span class="br0">&#40;</span><span class="co2">assets/success.png</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="re0">#demo-list</span> li<span class="re1">.file</span><span class="re1">.file-failed</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">background-image</span><span class="sy0">:</span> <span class="kw2">url</span><span class="br0">&#40;</span><span class="co2">assets/failed.png</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
&nbsp;<br />
<span class="re0">#demo-list</span> li<span class="re1">.file</span> <span class="re1">.file-name</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">font-size</span><span class="sy0">:</span> <span class="re3">1.2em</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">margin-left</span><span class="sy0">:</span> <span class="re3">44px</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">display</span><span class="sy0">:</span> <span class="kw2">block</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">clear</span><span class="sy0">:</span> <span class="kw1">left</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">line-height</span><span class="sy0">:</span> <span class="re3">40px</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">height</span><span class="sy0">:</span> <span class="re3">40px</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">font-weight</span><span class="sy0">:</span> <span class="kw2">bold</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="re0">#demo-list</span> li<span class="re1">.file</span> <span class="re1">.file-size</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">font-size</span><span class="sy0">:</span> <span class="re3">0.9em</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">line-height</span><span class="sy0">:</span> <span class="re3">18px</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">float</span><span class="sy0">:</span> <span class="kw1">right</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">margin-top</span><span class="sy0">:</span> <span class="re3">2px</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">margin-right</span><span class="sy0">:</span> <span class="re3">6px</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="re0">#demo-list</span> li<span class="re1">.file</span> <span class="re1">.file-info</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">display</span><span class="sy0">:</span> <span class="kw2">block</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">margin-left</span><span class="sy0">:</span> <span class="re3">44px</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">font-size</span><span class="sy0">:</span> <span class="re3">0.9em</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">line-height</span><span class="sy0">:</span> <span class="re3">20px</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">clear</span><br />
<span class="br0">&#125;</span><br />
<span class="re0">#demo-list</span> li<span class="re1">.file</span> <span class="re1">.file-remove</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">clear</span><span class="sy0">:</span> <span class="kw1">right</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">float</span><span class="sy0">:</span> <span class="kw1">right</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">line-height</span><span class="sy0">:</span> <span class="re3">18px</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">margin-right</span><span class="sy0">:</span> <span class="re3">6px</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div></td></tr></tbody></table></div>
<p><b>Javascript and MooTools</b><br />
<a href="http://www.hektorparis.com/hp-lab/fancyupload/showcase/photoqueue/script.js" target="_blank">/fancyupload/showcase/<b>photoqueue</b>/script.js</a></p>
<div class="codecolorer-container javascript mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br /></div></td><td><div class="javascript codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="coMULTI">/**<br />
&nbsp;* FancyUpload Showcase<br />
&nbsp;*<br />
&nbsp;* @license &nbsp; &nbsp; MIT License<br />
&nbsp;* @author&nbsp; &nbsp; &nbsp; Harald Kirschner &lt;mail [at] digitarald [dot] de&gt;<br />
&nbsp;* @copyright &nbsp; Authors<br />
&nbsp;*/</span><br />
&nbsp;<br />
window.<span class="me1">addEvent</span><span class="br0">&#40;</span><span class="st0">'domready'</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="co1">// wait for the content</span><br />
&nbsp;<br />
&nbsp; &nbsp; <span class="co1">// our uploader instance </span><br />
&nbsp;<br />
&nbsp; &nbsp; <span class="kw2">var</span> up <span class="sy0">=</span> <span class="kw2">new</span> FancyUpload2<span class="br0">&#40;</span>$<span class="br0">&#40;</span><span class="st0">'demo-status'</span><span class="br0">&#41;</span><span class="sy0">,</span> $<span class="br0">&#40;</span><span class="st0">'demo-list'</span><span class="br0">&#41;</span><span class="sy0">,</span> <span class="br0">&#123;</span> <span class="co1">// options object</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// we console.log infos, remove that in production!!</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; verbose<span class="sy0">:</span> <span class="kw2">true</span><span class="sy0">,</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// url is read from the form, so you just have to change one place</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; url<span class="sy0">:</span> $<span class="br0">&#40;</span><span class="st0">'form-demo'</span><span class="br0">&#41;</span>.<span class="me1">action</span><span class="sy0">,</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// path to the SWF file</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; path<span class="sy0">:</span> <span class="st0">'../../source/Swiff.Uploader.swf'</span><span class="sy0">,</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// remove that line to select all files, or edit it, add more items</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; typeFilter<span class="sy0">:</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">'Images (*.jpg, *.jpeg, *.gif, *.png)'</span><span class="sy0">:</span> <span class="st0">'*.jpg; *.jpeg; *.gif; *.png'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// this is our browse button, *target* is overlayed with the Flash movie</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; target<span class="sy0">:</span> <span class="st0">'demo-browse'</span><span class="sy0">,</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// graceful degradation, onLoad is only called if all went well with Flash</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">onLoad</span><span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">'demo-status'</span><span class="br0">&#41;</span>.<span class="me1">removeClass</span><span class="br0">&#40;</span><span class="st0">'hide'</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// we show the actual UI</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">'demo-fallback'</span><span class="br0">&#41;</span>.<span class="me1">destroy</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// ... and hide the plain form</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// We relay the interactions with the overlayed flash to the link</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">target</span>.<span class="me1">addEvents</span><span class="br0">&#40;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; click<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mouseenter<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">addClass</span><span class="br0">&#40;</span><span class="st0">'hover'</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mouseleave<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">removeClass</span><span class="br0">&#40;</span><span class="st0">'hover'</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="kw3">blur</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mousedown<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="kw3">focus</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Interactions for the 2 other buttons</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">'demo-clear'</span><span class="br0">&#41;</span>.<span class="me1">addEvent</span><span class="br0">&#40;</span><span class="st0">'click'</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; up.<span class="me1">remove</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// remove all files</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">'demo-upload'</span><span class="br0">&#41;</span>.<span class="me1">addEvent</span><span class="br0">&#40;</span><span class="st0">'click'</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; up.<span class="me1">start</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// start upload</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Edit the following lines, it is your custom event handling</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Is called when files were not added, &quot;files&quot; is an array of invalid File classes.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* This example creates a list of error elements directly in the file list, which<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* hide on click.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; onSelectFail<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span>files<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; files.<span class="me1">each</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span>file<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">new</span> Element<span class="br0">&#40;</span><span class="st0">'li'</span><span class="sy0">,</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">'class'</span><span class="sy0">:</span> <span class="st0">'validation-error'</span><span class="sy0">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; html<span class="sy0">:</span> file.<span class="me1">validationErrorMessage</span> <span class="sy0">||</span> file.<span class="me1">validationError</span><span class="sy0">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; title<span class="sy0">:</span> MooTools.<span class="me1">lang</span>.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">'FancyUpload'</span><span class="sy0">,</span> <span class="st0">'removeTitle'</span><span class="br0">&#41;</span><span class="sy0">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; events<span class="sy0">:</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; click<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">destroy</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>.<span class="me1">inject</span><span class="br0">&#40;</span><span class="kw1">this</span>.<span class="me1">list</span><span class="sy0">,</span> <span class="st0">'top'</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span> <span class="kw1">this</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* This one was directly in FancyUpload2 before, the event makes it<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* easier for you, to add your own response handling (you probably want<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* to send something else than JSON or different items).<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; onFileSuccess<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span>file<span class="sy0">,</span> response<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> json <span class="sy0">=</span> <span class="kw2">new</span> Hash<span class="br0">&#40;</span>JSON.<span class="me1">decode</span><span class="br0">&#40;</span>response<span class="sy0">,</span> <span class="kw2">true</span><span class="br0">&#41;</span> <span class="sy0">||</span> <span class="br0">&#123;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>json.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">'status'</span><span class="br0">&#41;</span> <span class="sy0">==</span> <span class="st0">'1'</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; file.<span class="me1">element</span>.<span class="me1">addClass</span><span class="br0">&#40;</span><span class="st0">'file-success'</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; file.<span class="me1">info</span>.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">'html'</span><span class="sy0">,</span> <span class="st0">'&lt;strong&gt;Image was uploaded:&lt;/strong&gt; '</span> <span class="sy0">+</span> json.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">'width'</span><span class="br0">&#41;</span> <span class="sy0">+</span> <span class="st0">' x '</span> <span class="sy0">+</span> json.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">'height'</span><span class="br0">&#41;</span> <span class="sy0">+</span> <span class="st0">'px, &lt;em&gt;'</span> <span class="sy0">+</span> json.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">'mime'</span><span class="br0">&#41;</span> <span class="sy0">+</span> <span class="st0">'&lt;/em&gt;)'</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; file.<span class="me1">element</span>.<span class="me1">addClass</span><span class="br0">&#40;</span><span class="st0">'file-failed'</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; file.<span class="me1">info</span>.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">'html'</span><span class="sy0">,</span> <span class="st0">'&lt;strong&gt;An error occured:&lt;/strong&gt; '</span> <span class="sy0">+</span> <span class="br0">&#40;</span>json.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">'error'</span><span class="br0">&#41;</span> <span class="sy0">?</span> <span class="br0">&#40;</span>json.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">'error'</span><span class="br0">&#41;</span> <span class="sy0">+</span> <span class="st0">' #'</span> <span class="sy0">+</span> json.<span class="me1">get</span><span class="br0">&#40;</span><span class="st0">'code'</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="sy0">:</span> response<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="sy0">,</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* onFail is called when the Flash movie got bashed by some browser plugin<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* like Adblock or Flashblock.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; onFail<span class="sy0">:</span> <span class="kw2">function</span><span class="br0">&#40;</span>error<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">switch</span> <span class="br0">&#40;</span>error<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="st0">'hidden'</span><span class="sy0">:</span> <span class="co1">// works after enabling the movie and clicking refresh</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'To enable the embedded uploader, unblock it in your browser and refresh (see Adblock).'</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="st0">'blocked'</span><span class="sy0">:</span> <span class="co1">// This no *full* fail, it works after the user clicks the button</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'To enable the embedded uploader, enable the blocked Flash movie (see Flashblock).'</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="st0">'empty'</span><span class="sy0">:</span> <span class="co1">// Oh oh, wrong path</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'A required file was not found, please be patient and we fix this.'</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="st0">'flash'</span><span class="sy0">:</span> <span class="co1">// no flash 9+ :(</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">alert</span><span class="br0">&#40;</span><span class="st0">'To enable the embedded uploader, install the latest Adobe Flash plugin.'</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp;<br />
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
<p><b>PHP Image Upload Script</b><br />
<u>/fancyupload/<b>showcase</b>/script.php</u><br />
<b>Note:</b> This script has been modified from its original form and I&#8217;ve commented out lines 39 through 58 to disable the showcase&#8217;s test mode and implemented code for production mode.</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br />154<br />155<br />156<br />157<br />158<br />159<br />160<br />161<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="co4">/**<br />
&nbsp; &nbsp; &nbsp;* Swiff.Uploader Example Backend<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* This file represents a simple logging, validation and output.<br />
&nbsp; &nbsp; &nbsp;* &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* WARNING: If you really copy these lines in your backend without<br />
&nbsp; &nbsp; &nbsp;* any modification, there is something seriously wrong! Drop me a line<br />
&nbsp; &nbsp; &nbsp;* and I can give you a good rate for fancy and customised installation.<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* No showcase represents 100% an actual real world file handling,<br />
&nbsp; &nbsp; &nbsp;* you need to move and process the file in your own code!<br />
&nbsp; &nbsp; &nbsp;* Just like you would do it with other uploaded files, nothing<br />
&nbsp; &nbsp; &nbsp;* special.<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* @license &nbsp; &nbsp; MIT License<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* @author&nbsp; &nbsp; &nbsp; Harald Kirschner &lt;mail [at] digitarald [dot] de&gt;<br />
&nbsp; &nbsp; &nbsp;* @copyright &nbsp; Authors<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co4">/**<br />
&nbsp; &nbsp; &nbsp;* Only needed if you have a logged in user, see option appendCookieData,<br />
&nbsp; &nbsp; &nbsp;* which adds session id and other available cookies to the sent data.<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* session_id($_POST['SID']); // whatever your session name is, adapt that!<br />
&nbsp; &nbsp; &nbsp;* session_start();<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">// Request log</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co4">/**<br />
&nbsp; &nbsp; &nbsp;* You don't need to log, this is just for the showcase. Better remove<br />
&nbsp; &nbsp; &nbsp;* those lines for production since the log contains detailed file<br />
&nbsp; &nbsp; &nbsp;* information.<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="coMULTI">/*$result = array();<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; $result['time'] &nbsp;= date('r');<br />
&nbsp; &nbsp; $result['addr'] &nbsp;= substr_replace(gethostbyaddr($_SERVER['REMOTE_ADDR']), '******', 0, 6);<br />
&nbsp; &nbsp; $result['agent'] = $_SERVER['HTTP_USER_AGENT'];<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; if(count($_GET)) &nbsp; { $result['get'] = $_GET; }<br />
&nbsp; &nbsp; if(count($_POST)) &nbsp;{ $result['post'] = $_POST; }<br />
&nbsp; &nbsp; if(count($_FILES)) { $result['files'] = $_FILES; }<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; // we kill an old file to keep the size small<br />
&nbsp; &nbsp; if(file_exists('script.log') &amp;&amp; filesize('script.log') &gt; 102400) { unlink('script.log'); }<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; $log = @fopen('script.log', 'a');<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; if($log)<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; fputs($log, print_r($result, true) . &quot;\n---\n&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; fclose($log);<br />
&nbsp; &nbsp; }*/</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">// Validation</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="re0">$error</span> <span class="sy0">=</span> <span class="kw2">false</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// NOTE: You need to create a directory if it doesn't already exist</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">// Specify directory path for your images directory</span><br />
&nbsp; &nbsp; <span class="re0">$upload_directory</span> &nbsp;<span class="sy0">=</span> <span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st_h">'DOCUMENT_ROOT'</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st0">&quot;/fancyupload/uploads/&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'Filedata'</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">||</span> <span class="sy0">!</span><a href="http://www.php.net/is_uploaded_file"><span class="kw3">is_uploaded_file</span></a><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'Filedata'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'tmp_name'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="re0">$error</span> <span class="sy0">=</span> <span class="st_h">'Invalid Upload'</span><span class="sy0">;</span> <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co4">/**<br />
&nbsp; &nbsp; &nbsp;* You would add more validation, checking image type or user rights.<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span><span class="re0">$error</span> <span class="sy0">&amp;&amp;</span> <span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'Filedata'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'size'</span><span class="br0">&#93;</span> <span class="sy0">&gt;</span> <span class="nu0">2</span> <span class="sy0">*</span> <span class="nu0">1024</span> <span class="sy0">*</span> <span class="nu0">1024</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="re0">$error</span> <span class="sy0">=</span> <span class="st_h">'Please upload only files smaller than 2Mb!'</span><span class="sy0">;</span> <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">else</span> <span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span><span class="re0">$error</span> <span class="sy0">&amp;&amp;</span> <span class="sy0">!</span><span class="br0">&#40;</span><span class="re0">$size</span> <span class="sy0">=</span> <span class="sy0">@</span><a href="http://www.php.net/getimagesize"><span class="kw3">getimagesize</span></a><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'Filedata'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'tmp_name'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="re0">$error</span> <span class="sy0">=</span> <span class="st_h">'Please upload only images, no other files are supported.'</span><span class="sy0">;</span> <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">else</span> <span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span><span class="re0">$error</span> <span class="sy0">&amp;&amp;</span> <span class="sy0">!</span><a href="http://www.php.net/in_array"><span class="kw3">in_array</span></a><span class="br0">&#40;</span><span class="re0">$size</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="sy0">,</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="nu0">1</span><span class="sy0">,</span> <span class="nu0">2</span><span class="sy0">,</span> <span class="nu0">3</span><span class="sy0">,</span> <span class="nu0">7</span><span class="sy0">,</span> <span class="nu0">8</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="re0">$error</span> <span class="sy0">=</span> <span class="st_h">'Please upload only images of type JPEG, GIF or PNG.'</span><span class="sy0">;</span> <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">else</span> <span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span><span class="re0">$error</span> <span class="sy0">&amp;&amp;</span> <span class="br0">&#40;</span><span class="re0">$size</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> <span class="sy0">&lt;</span> <span class="nu0">25</span><span class="br0">&#41;</span> <span class="sy0">||</span> <span class="br0">&#40;</span><span class="re0">$size</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> <span class="sy0">&lt;</span> <span class="nu0">25</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="re0">$error</span> <span class="sy0">=</span> <span class="st_h">'Please upload an image bigger than 25px.'</span><span class="sy0">;</span> <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">else</span> <span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span><span class="re0">$error</span> <span class="sy0">&amp;&amp;</span> <a href="http://www.php.net/file_exists"><span class="kw3">file_exists</span></a><span class="br0">&#40;</span><span class="re0">$upload_directory</span> <span class="sy0">.</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'Filedata'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'tmp_name'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="re0">$error</span> <span class="sy0">=</span> <span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st0">&quot;Filedata&quot;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&quot;name&quot;</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st0">&quot; already exists.&quot;</span><span class="sy0">;</span> <span class="br0">&#125;</span> &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">// Processing</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co4">/**<br />
&nbsp; &nbsp; &nbsp;* Its a demo, you would move or process the file like:<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* move_uploaded_file($_FILES['Filedata']['tmp_name'], '../uploads/' . $_FILES['Filedata']['name']);<br />
&nbsp; &nbsp; &nbsp;* $return['src'] = '/uploads/' . $_FILES['Filedata']['name'];<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* or<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* $return['link'] = YourImageLibrary::createThumbnail($_FILES['Filedata']['tmp_name']);<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$error</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="re0">$return</span> <span class="sy0">=</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st_h">'status'</span> <span class="sy0">=&gt;</span> <span class="st_h">'0'</span><span class="sy0">,</span> <span class="st_h">'error'</span> <span class="sy0">=&gt;</span> <span class="re0">$error</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="br0">&#125;</span> <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$return</span> <span class="sy0">=</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st_h">'status'</span> <span class="sy0">=&gt;</span> <span class="st_h">'1'</span><span class="sy0">,</span> <span class="st_h">'name'</span> <span class="sy0">=&gt;</span> <span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'Filedata'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'name'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Our processing, we get a hash value from the file</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$return</span><span class="br0">&#91;</span><span class="st_h">'hash'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <a href="http://www.php.net/md5_file"><span class="kw3">md5_file</span></a><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'Filedata'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'tmp_name'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// ... and if available, we get image data</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$info</span> <span class="sy0">=</span> <span class="sy0">@</span><a href="http://www.php.net/getimagesize"><span class="kw3">getimagesize</span></a><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'Filedata'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'tmp_name'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/***BOF FILE UPLOAD***/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Specify directory path for your images directory</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$upload_directory</span> &nbsp;<span class="sy0">=</span> <span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st_h">'DOCUMENT_ROOT'</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st0">&quot;/fancyupload/images/&quot;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Check that the images directory exists</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><a href="http://www.php.net/file_exists"><span class="kw3">file_exists</span></a><span class="br0">&#40;</span><span class="re0">$upload_directory</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Upload file or return error message information</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span><a href="http://www.php.net/move_uploaded_file"><span class="kw3">move_uploaded_file</span></a><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'Filedata'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'tmp_name'</span><span class="br0">&#93;</span><span class="sy0">,</span> <span class="re0">$upload_directory</span> <span class="sy0">.</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'Filedata'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'name'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$error</span> &nbsp;<span class="sy0">=</span> <span class="st0">&quot;Could not upload file &quot;</span> <span class="sy0">.</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st0">&quot;Filedata&quot;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st0">&quot;name&quot;</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st0">&quot;&lt;br /&gt;&quot;</span> <span class="sy0">.</span><span class="re0">$_FILES</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="coMULTI">/***EOF FILE UPLOAD***/</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$info</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$return</span><span class="br0">&#91;</span><span class="st_h">'width'</span><span class="br0">&#93;</span> &nbsp;<span class="sy0">=</span> <span class="re0">$info</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$return</span><span class="br0">&#91;</span><span class="st_h">'height'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$info</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$return</span><span class="br0">&#91;</span><span class="st_h">'mime'</span><span class="br0">&#93;</span> &nbsp; <span class="sy0">=</span> <span class="re0">$info</span><span class="br0">&#91;</span><span class="st_h">'mime'</span><span class="br0">&#93;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">// Output</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co4">/**<br />
&nbsp; &nbsp; &nbsp;* Again, a demo case. We can switch here, for different showcases<br />
&nbsp; &nbsp; &nbsp;* between different formats. You can also return plain data, like an URL<br />
&nbsp; &nbsp; &nbsp;* or whatever you want.<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* The Content-type headers are uncommented, since Flash doesn't care for them<br />
&nbsp; &nbsp; &nbsp;* anyway. This way also the IFrame-based uploader sees the content.<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st_h">'response'</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> <span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st_h">'response'</span><span class="br0">&#93;</span> <span class="sy0">==</span> <span class="st_h">'xml'</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// header('Content-type: text/xml');</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Really dirty, use DOM and CDATA section!</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st_h">'&lt;response&gt;'</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$return</span> <span class="kw1">as</span> <span class="re0">$key</span> <span class="sy0">=&gt;</span> <span class="re0">$value</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;&lt;<span class="es4">$key</span>&gt;&lt;![CDATA[<span class="es4">$value</span>]]&gt;&lt;/<span class="es4">$key</span>&gt;&quot;</span><span class="sy0">;</span> <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st_h">'&lt;/response&gt;'</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span> <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// header('Content-type: application/json');</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> json_encode<span class="br0">&#40;</span><span class="re0">$return</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span></div></td></tr></tbody></table></div>
<p><b>XHTML Markup</b><br />
<u>/fancyupload/showcase/<b>photoqueue</b>/index.html</u></p>
<div class="codecolorer-container html4strict mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br /></div></td><td><div class="html4strict codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc2">&lt;<a href="http://december.com/html/4/element/form.html"><span class="kw2">form</span></a> <span class="kw3">action</span><span class="sy0">=</span><span class="st0">&quot;../script.php&quot;</span> <span class="kw3">method</span><span class="sy0">=</span><span class="st0">&quot;post&quot;</span> <span class="kw3">enctype</span><span class="sy0">=</span><span class="st0">&quot;multipart/form-data&quot;</span> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;form-demo&quot;</span>&gt;</span><br />
&nbsp;<br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/fieldset.html"><span class="kw2">fieldset</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;demo-fallback&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/legend.html"><span class="kw2">legend</span></a>&gt;</span>File Upload<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/legend.html"><span class="kw2">legend</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; This form is just an example fallback for the unobtrusive behaviour of FancyUpload.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If this part is not changed, something must be wrong with your code.<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a> <span class="kw3">for</span><span class="sy0">=</span><span class="st0">&quot;demo-photoupload&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Upload a Photo:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;file&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;Filedata&quot;</span> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/fieldset.html"><span class="kw2">fieldset</span></a>&gt;</span><br />
&nbsp;<br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;demo-status&quot;</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;hide&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;#&quot;</span> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;demo-browse&quot;</span>&gt;</span>Browse Files<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a>&gt;</span> |<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;#&quot;</span> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;demo-clear&quot;</span>&gt;</span>Clear List<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a>&gt;</span> |<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;#&quot;</span> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;demo-upload&quot;</span>&gt;</span>Start Upload<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/strong.html"><span class="kw2">strong</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;overall-title&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/strong.html"><span class="kw2">strong</span></a>&gt;&lt;<a href="http://december.com/html/4/element/br.html"><span class="kw2">br</span></a> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/img.html"><span class="kw2">img</span></a> <span class="kw3">src</span><span class="sy0">=</span><span class="st0">&quot;../../assets/progress-bar/bar.gif&quot;</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;progress overall-progress&quot;</span> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/strong.html"><span class="kw2">strong</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;current-title&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/strong.html"><span class="kw2">strong</span></a>&gt;&lt;<a href="http://december.com/html/4/element/br.html"><span class="kw2">br</span></a> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/img.html"><span class="kw2">img</span></a> <span class="kw3">src</span><span class="sy0">=</span><span class="st0">&quot;../../assets/progress-bar/bar.gif&quot;</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;progress current-progress&quot;</span> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;current-text&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span><br />
&nbsp;<br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/ul.html"><span class="kw2">ul</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;demo-list&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/ul.html"><span class="kw2">ul</span></a>&gt;</span><br />
&nbsp;<br />
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/form.html"><span class="kw2">form</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p>Note that the &#8220;enctype&#8221; attribute for the form specifies the content-type  to use when submitting the form. The &#8220;multipart/form-data&#8221; is used when a form requires binary data, like the contents of a file, to be uploaded.</p>
<p><b>Putting it all together</b><br />
Modify <u>/fancyupload/showcase/<b>photoqueue</b>/index.html</u> to include all Javascript and CSS files necessary for FancyUpload to work properly.</p>
<div class="codecolorer-container html4strict mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br /></div></td><td><div class="html4strict codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc0">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;</span><br />
<span class="sc0">&quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/html.html"><span class="kw2">html</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/head.html"><span class="kw2">head</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/title.html"><span class="kw2">title</span></a>&gt;</span>FancyUpload Photo Queue Showcase<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/title.html"><span class="kw2">title</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/meta.html"><span class="kw2">meta</span></a> <span class="kw3">http-equiv</span><span class="sy0">=</span><span class="st0">&quot;Content-Type&quot;</span> <span class="kw3">content</span><span class="sy0">=</span><span class="st0">&quot;text/html; charset=iso-8859-1&quot;</span>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/link.html"><span class="kw2">link</span></a> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;style.css&quot;</span> <span class="kw3">rel</span><span class="sy0">=</span><span class="st0">&quot;stylesheet&quot;</span> <span class="kw3">media</span><span class="sy0">=</span><span class="st0">&quot;screen&quot;</span> <span class="sy0">/</span>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text/javascript&quot;</span> <span class="kw3">src</span><span class="sy0">=</span><span class="st0">&quot;http://ajax.googleapis.com/ajax/libs/mootools/1.2.2/mootools.js&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text/javascript&quot;</span> <span class="kw3">src</span><span class="sy0">=</span><span class="st0">&quot;../../source/Swiff.Uploader.js&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text/javascript&quot;</span> <span class="kw3">src</span><span class="sy0">=</span><span class="st0">&quot;../../source/Fx.ProgressBar.js&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text/javascript&quot;</span> <span class="kw3">src</span><span class="sy0">=</span><span class="st0">&quot;../../source/Lang.js&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text/javascript&quot;</span> <span class="kw3">src</span><span class="sy0">=</span><span class="st0">&quot;../../source/FancyUpload2.js&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text/javascript&quot;</span> <span class="kw3">src</span><span class="sy0">=</span><span class="st0">&quot;script.js&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/script.html"><span class="kw2">script</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/style.html"><span class="kw2">style</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text/css&quot;</span>&gt;</span><br />
&nbsp;body {<br />
&nbsp; &nbsp; font-family:Verdana, Arial, Helvetica, sans-serif;<br />
&nbsp; &nbsp; font-size:11px;<br />
&nbsp;}<br />
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/style.html"><span class="kw2">style</span></a>&gt;</span><br />
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/head.html"><span class="kw2">head</span></a>&gt;</span><br />
<span class="sc2">&lt;<a href="http://december.com/html/4/element/body.html"><span class="kw2">body</span></a>&gt;</span><br />
&nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/br.html"><span class="kw2">br</span></a> <span class="sy0">/</span>&gt;</span><br />
&nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a> <span class="kw3">style</span><span class="sy0">=</span><span class="st0">&quot;width:500px; margin-left:auto; margin-right:auto;&quot;</span>&gt;</span><br />
&nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/h3.html"><span class="kw2">h3</span></a>&gt;</span>Upload Multiple Images at Once using PHP and FancyUpload<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/h3.html"><span class="kw2">h3</span></a>&gt;</span><br />
&nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/form.html"><span class="kw2">form</span></a> <span class="kw3">action</span><span class="sy0">=</span><span class="st0">&quot;../script.php&quot;</span> <span class="kw3">method</span><span class="sy0">=</span><span class="st0">&quot;post&quot;</span> <span class="kw3">enctype</span><span class="sy0">=</span><span class="st0">&quot;multipart/form-data&quot;</span> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;form-demo&quot;</span>&gt;</span><br />
<br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/fieldset.html"><span class="kw2">fieldset</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;demo-fallback&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/legend.html"><span class="kw2">legend</span></a>&gt;</span>File Upload<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/legend.html"><span class="kw2">legend</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; This form is just an example fallback for the unobtrusive behaviour of FancyUpload.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If this part is not changed, something must be wrong with your code.<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a> <span class="kw3">for</span><span class="sy0">=</span><span class="st0">&quot;demo-photoupload&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Upload a Photo:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;file&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;Filedata&quot;</span> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/label.html"><span class="kw2">label</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/fieldset.html"><span class="kw2">fieldset</span></a>&gt;</span><br />
<br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;demo-status&quot;</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;hide&quot;</span>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;#&quot;</span> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;demo-browse&quot;</span>&gt;</span>Browse Files<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a>&gt;</span> <span class="sc1">&amp;nbsp;</span> | <span class="sc1">&amp;nbsp;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;#&quot;</span> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;demo-clear&quot;</span>&gt;</span>Clear List<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a>&gt;</span> <span class="sc1">&amp;nbsp;</span> | <span class="sc1">&amp;nbsp;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;#&quot;</span> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;demo-upload&quot;</span>&gt;</span>Start Upload<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a>&gt;</span><br />
&nbsp; &nbsp;<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/p.html"><span class="kw2">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/strong.html"><span class="kw2">strong</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;overall-title&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/strong.html"><span class="kw2">strong</span></a>&gt;&lt;<a href="http://december.com/html/4/element/br.html"><span class="kw2">br</span></a> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/img.html"><span class="kw2">img</span></a> <span class="kw3">src</span><span class="sy0">=</span><span class="st0">&quot;../../assets/progress-bar/bar.gif&quot;</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;progress overall-progress&quot;</span> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/strong.html"><span class="kw2">strong</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;current-title&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/strong.html"><span class="kw2">strong</span></a>&gt;&lt;<a href="http://december.com/html/4/element/br.html"><span class="kw2">br</span></a> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/img.html"><span class="kw2">img</span></a> <span class="kw3">src</span><span class="sy0">=</span><span class="st0">&quot;../../assets/progress-bar/bar.gif&quot;</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;progress current-progress&quot;</span> <span class="sy0">/</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;current-text&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span><br />
<br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/ul.html"><span class="kw2">ul</span></a> <span class="kw3">id</span><span class="sy0">=</span><span class="st0">&quot;demo-list&quot;</span>&gt;&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/ul.html"><span class="kw2">ul</span></a>&gt;</span><br />
<br />
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/form.html"><span class="kw2">form</span></a>&gt;</span><br />
&nbsp;<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/div.html"><span class="kw2">div</span></a>&gt;</span><br />
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/body.html"><span class="kw2">body</span></a>&gt;</span><br />
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/html.html"><span class="kw2">html</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p><b>Note:</b> You will need to include the <u>MooTools.Lang.js</u> Javascript for FancyUpload to work properly. For my installation I chose to put the file in <a href="http://www.hektorparis.com/hp-lab/fancyupload/source/Lang.js" target="_blank">/fancyupload/source/Lang.js</a> to maintain consistency by keeping all source files in the same directory.</p>
<p>FancyUpload is a creation of <a href="http://github.com/digitarald" target="_blank" title="digitarald's Profile">Harald Kirschner</a> and is available free under the <a href="http://www.opensource.org/licenses/mit-license.php" target="_blank">MIT License</a>.<br />
<br clear="all" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hektorparis.com/upload-multiple-images-at-once-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Install FCKeditor in osCommerce</title>
		<link>http://www.hektorparis.com/how-to-install-fckeditor-in-oscommerce/</link>
		<comments>http://www.hektorparis.com/how-to-install-fckeditor-in-oscommerce/#comments</comments>
		<pubDate>Mon, 18 May 2009 06:57:08 +0000</pubDate>
		<dc:creator>Hektor</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[osCommerce]]></category>
		<category><![CDATA[fckeditor]]></category>
		<category><![CDATA[fckeditor for oscommerce]]></category>
		<category><![CDATA[oscommerce product descriptions]]></category>
		<category><![CDATA[oscommerce wysiwyg editor]]></category>

		<guid isPermaLink="false">http://www.hektorparis.com/?p=415</guid>
		<description><![CDATA[Learn how to install WYSIWYG editor FCKeditor in osCommerce to use for product descriptions.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-423" title="fckeditor-in-oscommerce" src="http://www.hektorparis.com/wp-content/uploads/2009/05/fckeditor-in-oscommerce.jpg" alt="fckeditor-in-oscommerce" width="320" height="240" />Learn how to install WYSIWYG editor <a title="FCKeditor - The text editor for the Internet" href="http://www.fckeditor.net/" target="_blank">FCKeditor</a> in osCommerce to use for product descriptions.</p>
<p>FCKeditor is a web-based HTML text editor with similar functions as desktop applications like MS Word (<a title="FCKeditor Demo" href="http://www.fckeditor.net/demo" target="_blank">see demo</a>),Â  making it useful for creating esthetically pleasing product descriptions in osCommerce. </p>
<p>FCKeditor is compatible with IE 5.5+, Firefox 1.5+, Safari 3.0+, Opera 9.50+, Chrome, Camino 1.0+, Apple, Linux and Windows.  </p>
<p><span id="more-415"></span><br />
<br clear="left" /></p>
<h3>Read Me</h3>
<p>Before you begin work I recommend you backup your osCommerce database and that for any modifications you implement, instead of overwriting the original source code you should comment it out, this way you can revert changes in case you &#8220;FCKup&#8221; ha, ha, ha.</p>
<h3>Pre-Installation</h3>
<p><a title="Download FCKeditor" href="http://www.fckeditor.net/download" target="_blank">Download</a> the latest version of FCKeditor for free.</p>
<p>Decompress the FCKeditor file to your catalog&#8217;s admin directory.</p>
<p>Create a directory in your catalog&#8217;s root directory titled &#8220;userfiles&#8221; and within this directory create four more sub-directories titled &#8220;file&#8221;, &#8220;image&#8221;, &#8220;flash&#8221; and &#8220;media&#8221;.</p>
<p>Using <a title="FileZilla - The free FTP solution" href="http://filezilla-project.org/" target="_target">FileZilla</a> or your favorite FTP client upload the directories you&#8217;ve created,  <u>catalog/admin/fckeditor/</u> and <u>catalog/userfiles/</u> to your server.</p>
<p>Change read and write permissions to 777 for these directories:</p>
<p><u>catalog/userfiles/</u><br />
<u>catalog/userfiles/file</u><br />
<u>catalog/userfiles/media</u><br />
<u>catalog/userfiles/image</u><br />
<u>catalog/userfiles/flash</u></p>
<p>If you&#8217;re using  FileZilla right click on each directory and select &#8220;File Attributes&#8221; (or &#8220;File Permissions&#8221; in some versions).</p>
<h3 style="padding-top:10px;">Install FCKeditor for Products Description</h3>
<p>Open <span style="text-decoration: underline;"><a href="http://www.hektorparis.com/oscommerce/admin/categories.php.source.php">catalog/admin/categories.php</a></span></p>
<p><strong>Find Around <a href="http://www.hektorparis.com/oscommerce/admin/categories.php.source.php#l541">Line 541</a></strong></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><a href="http://www.php.net/echo"><span class="kw3">echo</span></a> tep_draw_textarea_field<span class="br0">&#40;</span><span class="st_h">'products_description['</span> <span class="sy0">.</span><span class="re0">$languages</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'id'</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st_h">']'</span><span class="sy0">,</span> <span class="st_h">'soft'</span><span class="sy0">,</span> <span class="st_h">'70'</span><span class="sy0">,</span> <span class="st_h">'15'</span><span class="sy0">,</span><br />
<span class="br0">&#40;</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$products_description</span><span class="br0">&#91;</span><span class="re0">$languages</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'id'</span><span class="br0">&#93;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><br />
? <a href="http://www.php.net/stripslashes"><span class="kw3">stripslashes</span></a><span class="br0">&#40;</span><span class="re0">$products_description</span><span class="br0">&#91;</span><span class="re0">$languages</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'id'</span><span class="br0">&#93;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><br />
<span class="sy0">:</span> tep_get_products_description<span class="br0">&#40;</span><span class="re0">$pInfo</span><span class="sy0">-&gt;</span><span class="me1">products_id</span><span class="sy0">,</span> <span class="re0">$languages</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'id'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
<p><strong>Replace With</strong></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="coMULTI">/***BOF FCKeditor v2.6.4***/</span><br />
<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> tep_draw_fckeditor<span class="br0">&#40;</span><span class="st_h">'products_description['</span> <span class="sy0">.</span><span class="re0">$languages</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'id'</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st_h">']'</span><span class="sy0">,</span> <span class="st_h">'600'</span><span class="sy0">,</span> <span class="st_h">'420'</span><span class="sy0">,</span><br />
<span class="br0">&#40;</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$products_description</span><span class="br0">&#91;</span><span class="re0">$languages</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'id'</span><span class="br0">&#93;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><br />
? <a href="http://www.php.net/stripslashes"><span class="kw3">stripslashes</span></a><span class="br0">&#40;</span><span class="re0">$products_description</span><span class="br0">&#91;</span><span class="re0">$languages</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'id'</span><span class="br0">&#93;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><br />
<span class="sy0">:</span> tep_get_products_description<span class="br0">&#40;</span><span class="re0">$pInfo</span><span class="sy0">-&gt;</span><span class="me1">products_id</span><span class="sy0">,</span> <span class="re0">$languages</span><span class="br0">&#91;</span><span class="re0">$i</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'id'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="coMULTI">/***EOF FCKeditor v2.6.4***/</span></div></td></tr></tbody></table></div>
<p>The <span style="color: #0000ff;">tep_draw_fckeditor()</span> function returns an instance of FCKeditor to replace the native  content editing textarea field created by the <a href="http://www.hektorparis.com/oscommerce/_functions/tep_draw_textarea_field.php" target="_blank">tep_draw_textarea_field()</a> function. You can change the width and height values (&#8216;600&#8242;, &#8216;420&#8242;) to fit your workspace.</p>
<p>Open <span style="text-decoration: underline;"><a title="osCommerce Admin html_output Function" href="http://www.hektorparis.com/oscommerce/admin/includes/functions/html_output.php.source.php" target="_blank">catalog/admin/includes/functions/html_ouput.php</a></span></p>
<p><strong>Around <a href="http://www.hektorparis.com/oscommerce/admin/includes/functions/html_output.php.php">Line 13</a></strong><br />
Insert the following <span style="color: #0000ff;">include_once()</span> just before this comment &nbsp; <i style="color:#FF9900;">// The HTML href link wrapper function</i></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="coMULTI">/***BOF FCKeditor v2.6.4***/</span><br />
<span class="kw1">include_once</span><span class="br0">&#40;</span><span class="st0">&quot;fckeditor/fckeditor.php&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="coMULTI">/***EOF FCKeditor v2.6.4***/</span></div></td></tr></tbody></table></div>
<p><strong>Find Around <a href="http://www.hektorparis.com/oscommerce/admin/includes/functions/html_output.php.source.php#l246" target="_blank">Line 245</a></strong></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw2">function</span> tep_draw_textarea_field<span class="br0">&#40;</span><span class="re0">$name</span><span class="sy0">,</span> <span class="re0">$wrap</span><span class="sy0">,</span> <span class="re0">$width</span><span class="sy0">,</span> <span class="re0">$height</span><span class="sy0">,</span> <span class="re0">$text</span> <span class="sy0">=</span> <span class="st_h">''</span><span class="sy0">,</span> <span class="re0">$parameters</span> <span class="sy0">=</span> <span class="st_h">''</span><span class="sy0">,</span> <span class="re0">$reinsert_value</span> <span class="sy0">=</span> <span class="kw2">true</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <a href="http://www.php.net/global"><span class="kw3">global</span></a> <span class="re0">$HTTP_GET_VARS</span><span class="sy0">,</span> <span class="re0">$HTTP_POST_VARS</span><span class="sy0">;</span><br />
&nbsp;<br />
&nbsp; <span class="re0">$field</span> <span class="sy0">=</span> <span class="st_h">'&lt;textarea name=&quot;'</span> <span class="sy0">.</span> tep_output_string<span class="br0">&#40;</span><span class="re0">$name</span><span class="br0">&#41;</span> <span class="sy0">.</span> <span class="st_h">'&quot; wrap=&quot;'</span> <span class="sy0">.</span> tep_output_string<span class="br0">&#40;</span><span class="re0">$wrap</span><span class="br0">&#41;</span> <span class="sy0">.</span> <span class="st_h">'&quot; cols=&quot;'</span> <span class="sy0">.</span> tep_output_string<span class="br0">&#40;</span><span class="re0">$width</span><span class="br0">&#41;</span> <span class="sy0">.</span> <span class="st_h">'&quot; rows=&quot;'</span> <span class="sy0">.</span> tep_output_string<span class="br0">&#40;</span><span class="re0">$height</span><span class="br0">&#41;</span> <span class="sy0">.</span> <span class="st_h">'&quot;'</span><span class="sy0">;</span><br />
&nbsp; <br />
&nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>tep_not_null<span class="br0">&#40;</span><span class="re0">$parameters</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="re0">$field</span> <span class="sy0">.=</span> <span class="st_h">' '</span> <span class="sy0">.</span> <span class="re0">$parameters</span><span class="sy0">;</span><br />
&nbsp; <br />
&nbsp; <span class="re0">$field</span> <span class="sy0">.=</span> <span class="st_h">'&gt;'</span><span class="sy0">;</span><br />
<br />
&nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span> <span class="br0">&#40;</span><span class="re0">$reinsert_value</span> <span class="sy0">==</span> <span class="kw2">true</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> <span class="br0">&#40;</span> <span class="br0">&#40;</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$HTTP_GET_VARS</span><span class="br0">&#91;</span><span class="re0">$name</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> <a href="http://www.php.net/is_string"><span class="kw3">is_string</span></a><span class="br0">&#40;</span><span class="re0">$HTTP_GET_VARS</span><span class="br0">&#91;</span><span class="re0">$name</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="sy0">||</span> <span class="br0">&#40;</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$HTTP_POST_VARS</span><span class="br0">&#91;</span><span class="re0">$name</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> <a href="http://www.php.net/is_string"><span class="kw3">is_string</span></a><span class="br0">&#40;</span><span class="re0">$HTTP_POST_VARS</span><span class="br0">&#91;</span><span class="re0">$name</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$HTTP_GET_VARS</span><span class="br0">&#91;</span><span class="re0">$name</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> <a href="http://www.php.net/is_string"><span class="kw3">is_string</span></a><span class="br0">&#40;</span><span class="re0">$HTTP_GET_VARS</span><span class="br0">&#91;</span><span class="re0">$name</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="re0">$field</span> <span class="sy0">.=</span> tep_output_string_protected<span class="br0">&#40;</span><a href="http://www.php.net/stripslashes"><span class="kw3">stripslashes</span></a><span class="br0">&#40;</span><span class="re0">$HTTP_GET_VARS</span><span class="br0">&#91;</span><span class="re0">$name</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp;<span class="br0">&#125;</span> <span class="kw1">elseif</span> <span class="br0">&#40;</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$HTTP_POST_VARS</span><span class="br0">&#91;</span><span class="re0">$name</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> <a href="http://www.php.net/is_string"><span class="kw3">is_string</span></a><span class="br0">&#40;</span><span class="re0">$HTTP_POST_VARS</span><span class="br0">&#91;</span><span class="re0">$name</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$field</span> <span class="sy0">.=</span> tep_output_string_protected<span class="br0">&#40;</span><a href="http://www.php.net/stripslashes"><span class="kw3">stripslashes</span></a><span class="br0">&#40;</span><span class="re0">$HTTP_POST_VARS</span><span class="br0">&#91;</span><span class="re0">$name</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span><br />
&nbsp; <span class="br0">&#125;</span> <br />
&nbsp; <br />
&nbsp; <span class="kw1">elseif</span> <span class="br0">&#40;</span>tep_not_null<span class="br0">&#40;</span><span class="re0">$text</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$field</span> <span class="sy0">.=</span> tep_output_string_protected<span class="br0">&#40;</span><span class="re0">$text</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; <span class="re0">$field</span> <span class="sy0">.=</span> <span class="st_h">'&lt;/textarea&gt;'</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; <span class="kw1">return</span> <span class="re0">$field</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div></td></tr></tbody></table></div>
<p><strong>After the Function Above Add</strong></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="coMULTI">/***BOF FCKeditor v2.6.4***/</span><br />
<span class="co1">////</span><br />
<span class="co1">// Output a form textarea field using FCKeditor v2.6.4</span><br />
<span class="kw2">function</span> tep_draw_fckeditor<span class="br0">&#40;</span><span class="re0">$name</span><span class="sy0">,</span> <span class="re0">$width</span><span class="sy0">,</span> <span class="re0">$height</span><span class="sy0">,</span> <span class="re0">$text</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="re0">$oFCKeditor</span> <span class="sy0">=</span> <span class="kw2">new</span> FCKeditor<span class="br0">&#40;</span><span class="re0">$name</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="re0">$oFCKeditor</span><span class="sy0">-&gt;</span><span class="me1">BasePath</span> <span class="sy0">=</span> <span class="st0">&quot;/admin/fckeditor/&quot;</span><span class="sy0">;</span><br />
<span class="re0">$oFCKeditor</span><span class="sy0">-&gt;</span><span class="me1">Width</span> &nbsp;<span class="sy0">=</span> <span class="re0">$width</span><span class="sy0">;</span><br />
<span class="re0">$oFCKeditor</span><span class="sy0">-&gt;</span><span class="me1">Height</span> <span class="sy0">=</span> <span class="re0">$height</span><span class="sy0">;</span><br />
<span class="re0">$oFCKeditor</span><span class="sy0">-&gt;</span><span class="me1">Config</span><span class="br0">&#91;</span><span class="st0">&quot;SkinPath&quot;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$oFCKeditor</span><span class="sy0">-&gt;</span><span class="me1">BasePath</span> <span class="sy0">.</span><span class="st0">&quot;editor/skins/silver/&quot;</span><span class="sy0">;</span><br />
<span class="re0">$oFCKeditor</span><span class="sy0">-&gt;</span><span class="me1">Value</span> <span class="sy0">=</span> <span class="re0">$text</span><span class="sy0">;</span><br />
<br />
<span class="re0">$editor</span> <span class="sy0">=</span> <span class="re0">$oFCKeditor</span><span class="sy0">-&gt;</span><span class="me1">Create</span><span class="br0">&#40;</span><span class="re0">$name</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
<span class="kw1">return</span> <span class="re0">$editor</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="coMULTI">/***EOF FCKeditor v2.6.4***/</span></div></td></tr></tbody></table></div>
<p>The <span style="color: #0000ff;">tep_draw_fckeditor()</span> function returns an instance of FCKeditor using parameters $name, $width, $height and inserts $text into the editor&#8217;s body. The $oFCKeditor->BasePath variable is self-explanatory, it defines the directory path for FCKeditor relative to the html_output.php file. This object variable is then used to <a title="Configuration Options - FCKeditor Docs" href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options" target="_blank">customize the configuration options</a> for the editor to use a &#8220;Silver&#8221; skin &amp; which <a title="SkinPath - FCKeditor Docs" href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options/SkinPath" target="_blank">you can change</a> if you&#8217;d like.</p>
<p>Open <u>catalog/admin/fckeditor/editor/filemanager/connectors/php/config.php</u> and configure this file by specifying the following values.</p>
<p><strong>Find at Line 27</strong></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="co1">// SECURITY: You must explicitly enable this &quot;connector&quot;. (Set it to &quot;true&quot;).</span><br />
<span class="co1">// WARNING: don't just set &quot;$Config['Enabled'] = true ;&quot;, you must be sure that only</span><br />
<span class="co1">// authenticated users can access this file or use some kind of session checking.</span><br />
<span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'Enabled'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
<p><strong>Find at Line 36</strong></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="co1">// Fill the following value it you prefer to specify the absolute path for the</span><br />
<span class="co1">// user files directory. Useful if you are using a virtual directory, symbolic</span><br />
<span class="co1">// link or alias. Examples: 'C:\\MySite\\userfiles\' or '/root/mysite/userfiles/'.</span><br />
<span class="co1">// Attention: The above 'UserFilesPath' must point to the same directory.</span><br />
<span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesAbsolutePath'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="st_h">'/YOUR/SERVERS/ABSOLUTE/PATH/TO/USERFILES/'</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
<p>To specify the absolute directory path to &#8220;userfiles&#8221; go to <u>osCommerce->Tools->Server Info</u>, scroll down to &#8220;Environtment&#8221; and copy the &#8220;DOCUMENT_ROOT&#8221; variable value. Paste it for $Config['UserFilesAbsolutePath'] and append &#8220;/userfiles/&#8221; at the end of the absolute path. For example, if your website is hosted on a Linux environment your absolute path might look like &#8220;/home/content/user/public_html&#8221; and you will append &#8220;/userfiles/&#8221; after &#8220;public_html&#8221; to complete the full path.</p>
<p><strong>Find at Line 127 &amp; 128</strong></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadPath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'File'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesPath'</span><span class="br0">&#93;</span> <span class="sy0">;</span><br />
<span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadAbsolutePath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'File'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesAbsolutePath'</span><span class="br0">&#93;</span> <span class="sy0">;</span></div></td></tr></tbody></table></div>
<p><strong>Replace With</strong></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadPath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'File'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesPath'</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st_h">'file/'</span><span class="sy0">;</span><br />
<span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadAbsolutePath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'File'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesAbsolutePath'</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st_h">'file/'</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
<p><strong>Find at Line 134 &amp; 135</strong></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadPath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'Image'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesPath'</span><span class="br0">&#93;</span> <span class="sy0">;</span><br />
<span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadAbsolutePath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'Image'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesAbsolutePath'</span><span class="br0">&#93;</span> <span class="sy0">;</span></div></td></tr></tbody></table></div>
<p><strong>Replace With</strong></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadPath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'Image'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesPath'</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st_h">'image/'</span><span class="sy0">;</span><br />
<span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadAbsolutePath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'Image'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesAbsolutePath'</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st_h">'image/'</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
<p><strong>Find at Line 141 &amp; 142</strong></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadPath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'Flash'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesPath'</span><span class="br0">&#93;</span> <span class="sy0">;</span><br />
<span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadAbsolutePath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'Flash'</span><span class="br0">&#93;</span><span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesAbsolutePath'</span><span class="br0">&#93;</span> <span class="sy0">;</span></div></td></tr></tbody></table></div>
<p><strong>Replace With</strong></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadPath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'Flash'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesPath'</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st_h">'flash/'</span><span class="sy0">;</span><br />
<span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadAbsolutePath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'Flash'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesAbsolutePath'</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st_h">'flash/'</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
<p><strong>Find at Line 148 &amp; 149</strong></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadPath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'Media'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesPath'</span><span class="br0">&#93;</span> <span class="sy0">;</span><br />
<span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadAbsolutePath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'Media'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesAbsolutePath'</span><span class="br0">&#93;</span> <span class="sy0">;</span></div></td></tr></tbody></table></div>
<p><strong>Replace With</strong></p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;width:590px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadPath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'Media'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesPath'</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st_h">'media/'</span><span class="sy0">;</span><br />
<span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'QuickUploadAbsolutePath'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'Media'</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$Config</span><span class="br0">&#91;</span><span class="st_h">'UserFilesAbsolutePath'</span><span class="br0">&#93;</span> <span class="sy0">.</span><span class="st_h">'media/'</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
<p>These fixes allow FCKeditor to upload files, images, flash and media to their directories in &#8220;userfiles&#8221; and allow the &#8220;browse server&#8221; button in the &#8220;Insert/Edit&#8221; window to list files previously uploaded.</p>
<p><a href="http://www.hektorparis.com/wp-content/uploads/2009/05/fckeditor-products-description.jpg"></a><br />
<strong>FCKeditor Installation Complete</strong><br />
Test the installation by going to <u>osCommerce->Catalog->Categories / Products</u>, select a product and click &#8220;Edit&#8221; from the right column. You should see an instance of FCKeditor in place for the products description.</p>
<p><a href="http://www.hektorparis.com/wp-content/uploads/2009/05/fckeditor-products-description.jpg"><img class="aligncenter size-full wp-image-465" title="fckeditor-products-description" src="http://www.hektorparis.com/wp-content/uploads/2009/05/fckeditor-products-description.jpg" alt="fckeditor-products-description" width="590" height="368" /></a></p>
<p><br clear="all"/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hektorparis.com/how-to-install-fckeditor-in-oscommerce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WD My Book 1 Terabyte HD Review</title>
		<link>http://www.hektorparis.com/wd-my-book-essential-edition-1-terabyte-hd-review/</link>
		<comments>http://www.hektorparis.com/wd-my-book-essential-edition-1-terabyte-hd-review/#comments</comments>
		<pubDate>Tue, 12 May 2009 08:08:12 +0000</pubDate>
		<dc:creator>Hektor</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[1 terabyte hard drives]]></category>
		<category><![CDATA[my book essential edition]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[western digital]]></category>
		<category><![CDATA[windows xp sp2 usb 2.0]]></category>

		<guid isPermaLink="false">http://www.hektorparis.com/?p=386</guid>
		<description><![CDATA[The WD My Book Essential Edition 1 terabyte external hard drive is elegant, energy efficient, simple to use and is about the size of a paperback book.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-387" style="border: 0pt none;" title="western-digital-my-book-essential-edition-1-terabyte" src="http://www.hektorparis.com/wp-content/uploads/2009/05/western-digital-my-book-essential-edition-1-terabyte.jpg" alt="western-digital-my-book-essential-edition-1-terabyte" width="300" height="300" />A dear friend of mine got me a present that will sure last me for a long time. I received a <a title="WD My Book Essential Edition 1 Terabyte External Hard Drive" href="http://www.wdc.com/en/products/products.asp?driveid=353" target="_blank">Western Digital My Book</a> Essential Edition 1 terabyte external hard drive. It is sleek, black, has a neon blue LED in the front and it&#8217;s easy to carry or fit in just about any space the size of a typical paperback book. I am happy with how simple it is to use My Book. </p>
<p>It works out of the box which includes the hard drive, an USB 2.0 cable and AC adapter. No waste of CD&#8217;s with product utilities because all the software you need comes pre-installed on the drive itself (good idea). The hard drive is also &#8220;smart&#8221; enough to be energy efficient and power on and off with my computer. With a prestigious brand name like Western Digital I know from experience this product is built to last, will pay for itself and will work every time.  <span id="more-386"></span></p>
<p>The drive&#8217;s pre-installed WD Application Installer is a bundle of four programs including:<br />
<br clear="all" /><br />
Google Desktop, Picasa and the Google Toolbar</p>
<p><a href="http://www.memeo.com/abstd.php" target="_blank">Memeo AutoBackup</a> (30 day trial) which is a one-time setup, backup application that allows you to preserve your data files with around-the-clock protection. Features include multiple destination backup and simple, intuitive file recovery.</p>
<p><a href="http://www.memeo.com/autosync.php" target="_blank">Memeo AutoSynch</a> (30-day trial) which safeguards your files using encryption with its simple, flexible sync plan setup and allows you to keep your latest work with you at all times.</p>
<p>And Copy Application Software which is a standard utility that allows you to back up the valuable software included on My Book to your internal drive.</li>
<p style="text-align: center;"><a href="http://www.hektorparis.com/wp-content/uploads/2009/05/wd-my-book-essential-edition-setup-software.gif" target="_blank"><img class="aligncenter size-full wp-image-388" style="border: 0pt none;" title="wd-my-book-essential-edition-setup-software" src="http://www.hektorparis.com/wp-content/uploads/2009/05/wd-my-book-essential-edition-setup-software.gif" alt="wd-my-book-essential-edition-setup-software" width="600" height="420" /></a></p>
<p><br clear="all" /><br />
My Book is compatible with Windows 2000/XP/Vista and Macintosh OS X 10.4.8+ and can only be used via USB. It is recommended that you have the latest service pack for Windows or Software Updates from Apple to enjoy your My Book out of the box. Since My Book is compatible with Windows and Macintosh the drive is preformatted as a single FAT32 partition. According to the <a href='http://www.hektorparis.com/wp-content/uploads/2009/05/wd-my-book-essential-edition-1-terabyte-user-manual.pdf' title="WD My Book Essential Edition 1 Terabyte User Manual" target="_blank">User&#8217;s Manual</a> the FAT32 file system has a maximum individual file size of 4 GB and the device cannot create partitions larger than 32 GB in Windows 2000/XP, but this limitation can be overcome by reformatting the drive to NTFS file system using the Disk Management utility.</p>
<p>Whether you&#8217;re a student, professional or occasional computer user, and especially if you&#8217;re a business owner, I strongly recommend you consider making a habit of backing up your files. I worked in IT for 5 years and I know firsthand the frustration and economic impact of data loss. Unfortunately hardware has a lifetime that may exceed its expectations or fail prematurely, but in case shit happens you should always have a backup, if anything for piece of mind. Fortunately for consumers and the IT industry the manufacturing costs of mass storage drives and devices are low enough that you can purchase a 1 TERABYTE (1,000 gigabytes) hard drive for less than $100 bux.<br />
<br clear="all" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hektorparis.com/wd-my-book-essential-edition-1-terabyte-hd-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
