<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.2" -->
<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://freecodesnippet.com/feed/atom/"
	>

<channel>
	<title>freecodesnippet.com</title>
	<atom:link href="http://freecodesnippet.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://freecodesnippet.com</link>
	<description>A blog all about programming!</description>
	<pubDate>Fri, 04 Jul 2008 11:55:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>
	<language>en</language>
			<item>
		<title>Surviving digg effect on wordpress</title>
		<link>http://freecodesnippet.com/articles/wordpress/surviving-digg-effect-on-wordpress/</link>
		<comments>http://freecodesnippet.com/articles/wordpress/surviving-digg-effect-on-wordpress/#comments</comments>
		<pubDate>Mon, 22 Oct 2007 18:45:32 +0000</pubDate>
		<dc:creator>guru</dc:creator>
		
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://freecodesnippet.com/articles/wordpress/surviving-digg-effect-on-wordpress/</guid>
		<description><![CDATA[Since you have reached this page, I&#8217;m assuming that your website is hosted on a shared server and has already been a victim of digg effect (or atleast know what it means) - now you want a solution.
Its always good to share your articles on Digg, it makes sure that your voice is heard. Everything goes well until your [...]]]></description>
			<content:encoded><![CDATA[<p><em><span style="font-family: trebuchet ms,geneva">Since you have reached this page, I&#8217;m assuming that your website is hosted on a shared server and has already been a victim of digg effect (or atleast know what it means) - now you want a solution.</span></em></p>
<p>Its always good to share your articles on Digg, it makes sure that your voice is heard. Everything goes well until your article reaches Digg&#8217;s front page. From that point onwards your website won&#8217;t be in your control anymore, you won&#8217;t be able to open your control panel or access your files through ftp. The massive traffic coming from Digg will kill the server that has hosted your website.<br />
If the administrator of the web server is monitoring the server there is no doubt that your account will be suspended. Even if the administrator is careless, you website won&#8217;t stay alive, there is no way that the server will be able to handle such traffic. You won&#8217;t have any other alternatives but to watch the traffic get wasted and feel helpless.</p>
<p><strong>Optimizing wordpress for handling Digg traffic:</strong></p>
<p>The first thing (and it is very important) you should do is, install a plug-in named <strong>wp-cache</strong> on wordpress. It simply caches your pages so that your server won&#8217;t have to execute same PHP code thousands of time per minute. To put it more simple, it changes your php files to html-like files.<br />
Believe me, this really works, I&#8217;ve tried it and it works.</p>
<p><span style="font-family: Trebuchet MS">Go get it now, installing wp-cache could be a hard job, but you should not give up on this one, even if it takes 2 hours you won&#8217;t regret installing it.<br />
</span><span style="font-family: Trebuchet MS"><em><strong>Let me give you a tip though (for installing wp-cache): </strong></em></span></p>
<ol>
<li><span style="font-family: Trebuchet MS"><em>Before you activate wp-cache plugin on wordpress, login to your cpanel and open the filemanager.<br />
(You can also use ftp)</em></span></li>
<li><em><span style="font-family: Trebuchet MS">Inside &#8216;/public_html&#8217; find the directory named &#8216;wp-content&#8217;.</span></em></li>
<li><em><span style="font-family: Trebuchet MS">Make sure you&#8217;ve set the permission for that directory to &#8216;777&#8242;, (although some might argue about security and stuff on doing this, this is your only chance of installing wp-cache without any headaches. And don&#8217;t worry about security, in a shared host environment other users will not have access to your folders anyway. If you are worried about the administrator accessing your files, you are better off buying a dedicated server, that way the whole issue won&#8217;t be an issue anymore)</span></em></li>
<li><em><span style="font-family: Trebuchet MS">Now you can activate wp-cache, it will configure everything itself.</span></em></li>
</ol>
<p><span style="font-family: Trebuchet MS">Link: <a target="_blank" href="http://wordpress.org/extend/plugins/wp-cache/" title="Get WP-CACHE | wordpress.org">Get the latest version of wp-cache!</a></span></p>
<p><strong>Even more things that you can do:<br />
</strong>Well these are the obvious things that you can do.</p>
<ul>
<li><span style="font-family: Trebuchet MS">Keep it simple, use less graphics, if you don&#8217;t want to end up with zero bandwidth remaining.</span></li>
<li><span style="font-family: Trebuchet MS">Use less plug-ins or disable unused plug-ins (although this might not be a problem after installing wp-cache)</span></li>
<li><span style="font-family: Trebuchet MS">You can also try disabling comments, although everyone love getting comments on their article.</span></li>
<li><span style="font-family: Trebuchet MS">Try not to use CAPTCHAs! (For example on comment form)</span></li>
<li><span style="font-family: Trebuchet MS">Don&#8217;t make wordpress send you an email each time you get a comment (Its just not needed).<br />
(Disable it from &#8216;<a href="http://wp-admin/options-discussion.php">wp-admin/options-discussion.php</a>&#8216; page, E-mail me whenever: Anyone posts a comment)</span></li>
<li>Get rid of anything that can abuse the server and has least importance.</li>
<li><span style="font-family: Trebuchet MS">Use less JavaScript? Just kidding! In fact spare the server and try to do more with Java Scripts if possible.</span></li>
</ul>
<p><strong>And if nothing works?</strong><br />
You don&#8217;t have many options really, do one of following.</p>
<ul>
<li>Use blogger.com, it even lets you use your own domain name.</li>
<li>Use caching services like <a target="_blank" href="http://www.coralcdn.org/overview/" title="Coral Cache">coral cache</a>, i.e. submit the cached page on Digg. This has some obvious disadvantages. </li>
<li>If your blog earns enough money for you, its time to buy a dedicated server.</li>
</ul>
<p>One more thing that you can do is, wait for your article to become popular, once it is popular and listed on <a target="_blank" href="http://duggmirror.com" title="duggmirror.com">duggmirror.com</a>, redirect the traffic to the cached page on duggmirror.com, to know more about duggmirror, visit their site.</p>
<p><strong>How to redirect?</strong></p>
<ul>
<li>Using .htaccess file on your server. (Using <u>Redirectmatch</u> command). This is only possible if you can still access the server thorough cpanel or ftp, which is very unlikely.</li>
<li>Using <a target="_blank" href="http://everydns.net/" title="EveryDNS">http://everydns.net/</a> visit the site for more info.</li>
</ul>
<p><span style="font-family: trebuchet ms,geneva"><em>Don&#8217;t feel shy to add your techniques below, through comment</em>.<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://freecodesnippet.com/articles/wordpress/surviving-digg-effect-on-wordpress/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Preventing spam on your website without using captcha</title>
		<link>http://freecodesnippet.com/articles/security/preventing-spam-on-your-website-without-using-captcha/</link>
		<comments>http://freecodesnippet.com/articles/security/preventing-spam-on-your-website-without-using-captcha/#comments</comments>
		<pubDate>Tue, 16 Oct 2007 09:40:11 +0000</pubDate>
		<dc:creator>guru</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://freecodesnippet.com/articles/security/preventing-spam-on-your-website-without-using-captcha/</guid>
		<description><![CDATA[This article is based on a simple fact that spam-robots are so dumb they usually put their grand father (their developers) to a shame.
Concept:
For people who don&#8217;t know this trick already, here is how you do it:

Add an input field to your form, with some interesting name, for example &#8216;URL&#8217;.
&#60;input name="url" type="text" value=""/&#62;
Hide the input box [...]]]></description>
			<content:encoded><![CDATA[<p>This article is based on a simple fact that spam-robots are so dumb they usually put their grand father (their developers) to a shame.</p>
<p><strong>Concept:</strong><br />
For people who don&#8217;t know this trick already, here is how you do it:</p>
<ol>
<li>Add an input field to your form, with some interesting name, for example &#8216;URL&#8217;.<br />
<code>&lt;input name="url" type="text" value=""/&gt;</code></li>
<li>Hide the input box using css so that users(genuine) cannot see it directly.<br />
<code>&lt;style&gt;<br />
.style1 {<br />
  display: none;<br />
}<br />
&lt;/style&gt;<br />
&lt;p class="style1"&gt;&lt;input name="url" type="text" value=""/&gt;&lt;/p&gt;</code></li>
<li>While processing the form check if the &#8220;url&#8221; contains any value. If it does, reject the post or put it for moderation.<br />
<code>if (strlen(trim($_POST['url'])) &gt; 0){<br />
//It is a spam, reject this post here<br />
}</code></li>
<li>Didn&#8217;t get it? Why this works? Well, it works simply because geniune users cannot see a hidden input box on your form and therefore, they won&#8217;t fill it, while robots can.</li>
</ol>
<p> <a href="http://freecodesnippet.com/articles/security/preventing-spam-on-your-website-without-using-captcha/#more-50" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://freecodesnippet.com/articles/security/preventing-spam-on-your-website-without-using-captcha/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Web ideas conference october 2007</title>
		<link>http://freecodesnippet.com/articles/uncategorized/web-ideas-conference-october-2007/</link>
		<comments>http://freecodesnippet.com/articles/uncategorized/web-ideas-conference-october-2007/#comments</comments>
		<pubDate>Tue, 09 Oct 2007 04:55:22 +0000</pubDate>
		<dc:creator>guru</dc:creator>
		
		<category><![CDATA[News]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://freecodesnippet.com/articles/uncategorized/web-ideas-conference-october-2007/</guid>
		<description><![CDATA[Hey guys,
Check out: The web ideas conference Oct2007, an interesting new project, being launched by technociti.
I&#8217;ve posted this news here following a request made by Mr. Sudip, the team leader of this project. If you are interested, read and follow the instructions from the link I&#8217;ve given above.
For further informations contact Mr. Sudip: ConferenceOct07[at]technociti.com (MSN)
Please note that freecodesnippet.com is not affiliated [...]]]></description>
			<content:encoded><![CDATA[<p>Hey guys,</p>
<p>Check out: <a target="_blank" href="http://technociti.com/forum/func,view/catid,42/id,38/" title="Web ideas conference october 2007">The web ideas conference Oct2007</a>, an interesting new project, being launched by technociti.</p>
<p>I&#8217;ve posted this news here following a request made by Mr. Sudip, the team leader of this project. If you are interested, read and follow the instructions from the link I&#8217;ve given above.</p>
<p>For further informations contact Mr. Sudip: <strong>ConferenceOct07[at]technociti.com</strong> (MSN)</p>
<p><span style="font-family: trebuchet ms,geneva"><em>Please note that freecodesnippet.com is not affiliated with this project although we are very much excited about it&#8217;s progress, therefore please do not contact fcs for informations on this project.</em></span></p>
]]></content:encoded>
			<wfw:commentRss>http://freecodesnippet.com/articles/uncategorized/web-ideas-conference-october-2007/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AJAX server to server direct file transfer UPDATED</title>
		<link>http://freecodesnippet.com/articles/php/ajax-server-to-server-direct-file-transfer-updated/</link>
		<comments>http://freecodesnippet.com/articles/php/ajax-server-to-server-direct-file-transfer-updated/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 20:24:55 +0000</pubDate>
		<dc:creator>guru</dc:creator>
		
		<category><![CDATA[fcs]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://freecodesnippet.com/articles/uncategorized/ajax-server-to-server-direct-file-transfer-updated/</guid>
		<description><![CDATA[A while ago, I had posted an article about transferring files from one server to another directly, that also included an AJAX demo. An updated version of the AJAX demo is now available to download from this post.
I had always been missing a system like this in Wordpress and Joomla (to install plug ins). This [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago, I had posted an article about transferring files from one server to another directly, that also included an AJAX demo. An updated version of the AJAX demo is now available to download from this post.</p>
<blockquote><p>I had always been missing a system like this in Wordpress and Joomla (to install plug ins). This codes snippet lets to transfer files directly from one server to another without having to do a pesky job of downloading them to your computer first and uploading it afterwards.</p></blockquote>
<p><em>This code was updated to <span style="text-decoration: line-through">Version 1.1</span> Version 1.2:</em></p>
<p><span style="font-family: trebuchet ms,geneva"><a href="http://freecodesnippet.com/articles/uncategorized/ajax-server-to-server-direct-file-transfer/">[See older version of this code]</a> </span></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<strong>Updates (Version 1.2):<br />
</strong>- Windows file path problems solved<br />
- Bug fixes<br />
- Faster and safer file transfer system<br />
- Added AJAX progress bar to indicate file transfer progress</p>
<p><strong>Furture plans:</strong><br />
- Add an ability to cancel file transfer process<br />
- fix more bugs</p>
<p><strong>Screen shot of S2S:</strong></p>
<p><a href="http://freecodesnippet.com/wp-content/uploads/2007/09/s2sdemo-v11.gif" title="AJAX Server to Server direct file transfer v1.1"></a></p>
<p style="text-align: center"><a href="http://freecodesnippet.com/wp-content/uploads/2007/09/s2sdemo-v11.gif" title="AJAX Server to Server direct file transfer v1.1"><img src="http://freecodesnippet.com/wp-content/uploads/2007/09/s2sdemo-v11.thumbnail.gif" alt="AJAX Server to Server direct file transfer v1.1" /></a></p>
<p><strong>Download source code:</strong><br />
<a href="http://freecodesnippet.com/wp-content/uploads/2007/10/s2sdemo-v12.zip" title="AJAX Server to Server direct file transfer v1.2 Source">AJAX Server to Server direct file transfer v1.2 Source</a></p>
<p><strong>Installation:</strong></p>
<ol>
<li>Upload the source code to your server and extract the archived file.</li>
<li>Rename the extracted folder to something easier, for example &#8217;s2s&#8217;.</li>
<li>You should be able to access the software like http://yousite.com/s2s/index.php</li>
<li>If you find any problem, contact me. [online(at)nishadh.com.np]</li>
</ol>
<p><span style="font-family: trebuchet ms,geneva"><em>As always, feel free to report any bug or post and feed back through the comment section. </em></span></p>
]]></content:encoded>
			<wfw:commentRss>http://freecodesnippet.com/articles/php/ajax-server-to-server-direct-file-transfer-updated/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AJAX Server to Server direct file transfer</title>
		<link>http://freecodesnippet.com/articles/uncategorized/ajax-server-to-server-direct-file-transfer/</link>
		<comments>http://freecodesnippet.com/articles/uncategorized/ajax-server-to-server-direct-file-transfer/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 20:36:15 +0000</pubDate>
		<dc:creator>guru</dc:creator>
		
		<category><![CDATA[HTML]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://freecodesnippet.com/articles/uncategorized/ajax-server-to-server-direct-file-transfer/</guid>
		<description><![CDATA[[An updated version of this code is now available!] 
I had always been missing a system like this in Wordpress and Joomla (to install plug ins). This codes snippet lets to transfer files directly from one server to another without having to do a pesky job of downloading them to your computer first and uploading it [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: trebuchet ms,geneva"><span style="font-family: trebuchet ms,geneva">[<a href="http://freecodesnippet.com/articles/php/ajax-server-to-server-direct-file-transfer-updated/" title="AJAX server to server direct file transfer UPDATED V1.1">An updated version of this code is now available!</a>]</span> </span></p>
<p>I had always been missing a system like this in Wordpress and Joomla (to install plug ins). This codes snippet lets to transfer files directly from one server to another without having to do a pesky job of downloading them to your computer first and uploading it afterwards.</p>
<p>Here is the code for the PHP part:<br />
<span style="font-family: trebuchet ms,geneva"><em>Please scroll down for the AJAX implementation of this code snippet.</em></span></p>
<textarea name="code" class="php:collapse" cols="60" rows="10">
/*****************************************
*Filename: s2s.php
*Programmed by: guru
*Published by: http://freecodesnippet.com
*Version: 1.0
*****************************************/
define ("ERROR_MSG", "Error: Please enter a valid URL!");
define ("SUCCESS_MSG", "Success: The file %s had been transfered to the server.");

define ("CONFIG_BoxedFolder", "UploadedFiles/");
function transferfile($url){
echo "Please Wait!";
$filepath=CONFIG_BoxedFolder.basename($url);
// return copy($url, $filepath); use this if your PHP supports it (Works from PHP v4.3).
$ret = false;
$fp = fopen($url, "rb");
if ($fp){
$fp_Dest = fopen($filepath, "wb");
if ($fp_Dest){
$BinaryData = '';
while (!feof($fp)) {
$BinaryData .= fread($fp, 8192);
}
$ret = fwrite($fp_Dest, $BinaryData);
fclose($fp_Dest);
}
fclose($fp);
}
return $ret;
}
if (isset($_GET['url'])){
$filepath = $_GET['url'];
if (transferfile($filepath)){
//Exit the program with our success message
exit(str_replace("%s", basename($filepath), SUCCESS_MSG));
}
}

else echo ERROR_MSG;
?&gt;
</textarea>
<p>The above code works fine except when the files are too large. If it takes too much time for PHP to copy the file, it simply halts transferring file due to browser&#8217;s connection timeout.</p>
<p><strong>To tackle this problem</strong> I&#8217;ve created a full AJAX implemented version of this code, based on the &#8216;PHP file manager (AJAX demo)&#8217; I posted earlier.</p>
<p><strong>AJAX implementation:</strong><br />
The above code is just for concept, its better to get the AJAX version of this code snippet.</p>
<p><a href="http://freecodesnippet.com/wp-content/uploads/2007/09/s2sdemo.gif" title="Server2Server demo screen shot"></a><a href="http://freecodesnippet.com/wp-content/uploads/2007/09/s2sdemo.gif" title="Server2Server demo screen shot"></a></p>
<p style="text-align: center"><a href="http://freecodesnippet.com/wp-content/uploads/2007/09/s2sdemo.gif" title="Server2Server demo screen shot"><img src="http://freecodesnippet.com/wp-content/uploads/2007/09/s2sdemo.thumbnail.gif" alt="Server2Server demo screen shot" /></a></p>
<p><strong>Download Source:</strong></p>
<p>UPDATED v1.1: <a href="http://freecodesnippet.com/wp-content/uploads/2007/09/s2sdemo-v11.zip">AJAX Server to Server direct file transfer v1.1 Source </a></p>
<p>OLD v1.0: <a href="http://freecodesnippet.com/wp-content/uploads/2007/09/s2sdemo.zip" title="Server to Server AJAX implementation source code">Server to Server AJAX implementation FULL source code</a></p>
<p><strong>Furture Plans:</strong></p>
<ol>
<li>Add a progress bar to indicate file transferring progress.</li>
<li>To fix all bugs <img src='http://freecodesnippet.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </li>
</ol>
<p><em>If you find any bug (and you might find some cause the coding was done in couple of hours) or problems please let me know.</em> Comment below for anything!</p>
]]></content:encoded>
			<wfw:commentRss>http://freecodesnippet.com/articles/uncategorized/ajax-server-to-server-direct-file-transfer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Persistent database connection, clearing the mysteries</title>
		<link>http://freecodesnippet.com/articles/php/persistent-database-connection-clearing-the-mysteries/</link>
		<comments>http://freecodesnippet.com/articles/php/persistent-database-connection-clearing-the-mysteries/#comments</comments>
		<pubDate>Sun, 23 Sep 2007 17:08:58 +0000</pubDate>
		<dc:creator>guru</dc:creator>
		
		<category><![CDATA[mysql]]></category>

		<category><![CDATA[Apache]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://freecodesnippet.com/articles/php/persistent-database-connection-clearing-the-mysteries/</guid>
		<description><![CDATA[What are persistent database connections?
There are two ways that you can use database on PHP,

Open a connection to the database, perform your query and then close it. Repeat the same thing for each and every query or at least each and every page.
Open a connection to the database, perform your query, leave the connection unclosed so that [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What are persistent database connections?</strong><br />
There are two ways that you can use database on PHP,</p>
<ol>
<li>Open a connection to the database, perform your query and then close it. Repeat the same thing for each and every query or at least each and every page.</li>
<li>Open a connection to the database, perform your query, leave the connection unclosed so that next time you can use same connection to perform other queries.</li>
</ol>
<p>If you follow the second method, you are using a persistent database connection for your web application.<br />
 <a href="http://freecodesnippet.com/articles/php/persistent-database-connection-clearing-the-mysteries/#more-38" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://freecodesnippet.com/articles/php/persistent-database-connection-clearing-the-mysteries/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DIV vs. Table, what is the right way to do it?</title>
		<link>http://freecodesnippet.com/articles/html/div-vs-table-what-is-the-right-way-to-do-it/</link>
		<comments>http://freecodesnippet.com/articles/html/div-vs-table-what-is-the-right-way-to-do-it/#comments</comments>
		<pubDate>Sun, 23 Sep 2007 08:58:00 +0000</pubDate>
		<dc:creator>guru</dc:creator>
		
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://freecodesnippet.com/articles/uncategorized/div-vs-table-what-is-the-right-way-to-do-it/</guid>
		<description><![CDATA[Everyone has their choices, some care about the right way to do it while others about the easier way.
CSS has revolutionized the web page designing process, its fun that way. DIV vs. TABLE when it comes to web designing is more of a confusion for some web page designers.
Simplicity is there with Tables, but with DIV [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone has their choices, some care about the right way to do it while others about the easier way.</p>
<p>CSS has revolutionized the web page designing process, its fun that way. DIV vs. TABLE when it comes to web designing is more of a confusion for some web page designers.</p>
<p><em>Simplicity</em> is there with Tables, but with DIV there is <em>flexibility and expandability</em>. Use DIV and with a simple flick on your CSS file , your web page gets a whole new look. Using DIV you can explore new possibilities for web page designing for example, Table does not provide overlapping features like DIV.</p>
<p>The bottom line is that, if you want to take full advantages of CSS, there is only one option for you and that&#8217;s DIV.</p>
<p><strong>When should I use Tables?</strong><br />
Some people have a misconception that using Tables slows down web page loading. There are places where Tables can do magic, use DIV doesn&#8217;t mean, ignore Tables completely. If you use Tables wisely it can save you a several lines of code. You should use Tables in places like DATA listing and places where you need to separate columns quickly.</p>
<p>As programmers are always looking for a flexible and expandable programs, using DIV as the main frame for your web page is the best thing you can do.</p>
<p><strong>When should I use Tables as main frame for my web page?</strong><br />
If you have a light static web page, that can even do without using an external CSS file, you can use Tables as the main frame for your web page.</p>
<p><strong>Conclusion:</strong><br />
In fact Tables and DIVs are two different things, aim to serve two different purposes, although sometimes its possible to use them exchangeably, its never a good idea to mix them up. Use DIV for making layers or divisions your web page like, header, side bars and footer. Use tables when you need to list data in a spreadsheet-like interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://freecodesnippet.com/articles/html/div-vs-table-what-is-the-right-way-to-do-it/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A better experience with file uploading through PHP</title>
		<link>http://freecodesnippet.com/articles/php/a-better-experience-with-file-uploading-through-php/</link>
		<comments>http://freecodesnippet.com/articles/php/a-better-experience-with-file-uploading-through-php/#comments</comments>
		<pubDate>Sun, 23 Sep 2007 07:45:57 +0000</pubDate>
		<dc:creator>guru</dc:creator>
		
		<category><![CDATA[HTML]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://freecodesnippet.com/articles/php/a-better-experience-with-file-uploading-through-php/</guid>
		<description><![CDATA[As web technology evolves, a focus has always been on trying to make a web application act more like a desktop application. This involves the implementations of techniques like AJAX and DOM to make web pages act more swift and sound. In this article we&#8217;ll talk about ways to improve the file uploading experience with [...]]]></description>
			<content:encoded><![CDATA[<p>As web technology evolves, a focus has always been on trying to make a web application act more like a desktop application. This involves the implementations of techniques like AJAX and DOM to make web pages act more swift and sound. In this article we&#8217;ll talk about ways to improve the file uploading experience with PHP.</p>
<p>Traditionally, while uploading files, you specify the file path in a &#8216;HTML file input&#8217; field. The file is uploaded to the server when submitting the form.</p>
<p><strong>There are two problems with this method:</strong></p>
<ol>
<li>Submitting the form refreshes the page, or loads another page.</li>
<li>While uploading BIG files there is no indicator to show the data transfer progress.</li>
</ol>
<p>There aren&#8217;t many remedies to solve this problem.<br />
<strong>Here is the list of things that we <em>can&#8217;t</em> do:</strong></p>
<ol>
<li>Uploading files with AJAX.<br />
This is because JavaScript has no access to local files.</li>
<li>Report the progress while a file is being uploaded. This is a problem, that only exists with PHP.</li>
</ol>
<p><strong>Clearing out doubts:</strong></p>
<ol>
<li>Can I submit a HTML form using AJAX with POST method?<br />
Yes, it is possible. What&#8217;s not possible is to submit a file using AJAX.</li>
</ol>
<p><strong>Alternative ways:</strong><br />
An alternative to AJAX to prevent page reloading is to use inline frames. An inline frame can load one HTML files within another. So if you put your form inside an inline frame, submitting the form won&#8217;t reload the whole page.</p>
<p><strong>What about a progress bar or an indicator for uploading progress?</strong><br />
To tell you the truth, it is impossible. It can&#8217;t be done using PHP alone.</p>
<p>PHP uses a function, &#8216;move_uploaded_file&#8217; to move the already uploaded files to destination directory on the server. The files are initially uploaded to a temporary directory and there is no way to access that file while the uploading is in progress.</p>
<p><strong>Any alternative to that?</strong></p>
<ol>
<li>You can use a BIT of help from other PHP like languages like Perl or Java, just for uploading process. But, for that, you need to have them installed at the first place of course.</li>
<li>You can also modify PHP itself, to provide a way to access the properties of the temporary file it uses while the uploading is in progress. But its almost impossible on shared hosting environment.</li>
<li>You can use client sided component like Java applet or a flash object to upload the files in a much more controlled way. But I think you are better off without it, for small files.</li>
</ol>
<p><strong>Can I get CODE for the iframe technique?<br />
</strong>Not now, you can either search for it on google, or comment on this post to have me write a code for that.</p>
]]></content:encoded>
			<wfw:commentRss>http://freecodesnippet.com/articles/php/a-better-experience-with-file-uploading-through-php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What is AJAX?</title>
		<link>http://freecodesnippet.com/articles/php/what-is-ajax/</link>
		<comments>http://freecodesnippet.com/articles/php/what-is-ajax/#comments</comments>
		<pubDate>Thu, 20 Sep 2007 05:59:15 +0000</pubDate>
		<dc:creator>guru</dc:creator>
		
		<category><![CDATA[Quick Info]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://freecodesnippet.com/articles/php/what-is-ajax/</guid>
		<description><![CDATA[AJAX is a soccer club in the dutch league.  
You might have heard a thousand times that big websites like gmail or live mail uses AJAX technology. You might think its a component like flash or java applet. Infact its about 5 lines of javascript. So, lets reduce it&#8217;s name from AJAX technology to [...]]]></description>
			<content:encoded><![CDATA[<p><em>AJAX is a soccer club in the dutch league. <img src='http://freecodesnippet.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </em></p>
<p>You might have heard a thousand times that big websites like gmail or live mail uses AJAX technology. You might think its a component like flash or java applet. Infact its about 5 lines of javascript. So, lets reduce it&#8217;s name from AJAX technology to AJAX technique.</p>
<blockquote><p>HINT: Do you know about HTML inline frames , if you have ever used an inline frame on your webpage, your are one step ahead to understand the core concept of AJAX technique.</p></blockquote>
<p><span style="font-size: 90%; font-family: trebuchet ms,geneva">If you don&#8217;t know about dynamic web pages and server sided scripts like PHP, you will not understand what AJAX means, an article is soon coming for this.</span></p>
<p><strong>Main concept</strong> (You can start reading here):<br />
The power of AJAX is unbelievable, let me show you an example.<br />
Imagine that you are writing a simple file manager script. While loading, the files are listed on the web page like this:</p>
<p style="text-align: center"><img src="http://freecodesnippet.com/wp-content/uploads/2007/09/ajax-demo.png" alt="What is AJAX?" /></p>
<p><span style="font-size: 90%; font-family: trebuchet ms,geneva"><a href="http://freecodesnippet.com/wp-content/uploads/2007/09/php-filemanager-ajax-demo.zip" title="AJAX demonstration using a simple PHP file manager">[download source code]</a></span></p>
<p><em>Our <strong>first </strong>objective here is to &#8217;send <strong>delete </strong>command to the server&#8217; without reloading the web page like &#8216;filemanager.php?action=delete&amp;file=myfile.zip&#8217; or loading other pages, when user clicks on &#8216;Delete&#8217;.</em></p>
<p><em>The <strong>second</strong> objective is to remove the deleted file from the list without refreshing the whole web page.</em></p>
<p> <a href="http://freecodesnippet.com/articles/php/what-is-ajax/#more-28" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://freecodesnippet.com/articles/php/what-is-ajax/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HTML color picker</title>
		<link>http://freecodesnippet.com/articles/visual-basic-6/html-color-picker/</link>
		<comments>http://freecodesnippet.com/articles/visual-basic-6/html-color-picker/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 12:31:23 +0000</pubDate>
		<dc:creator>guru</dc:creator>
		
		<category><![CDATA[Visual basic 6]]></category>

		<guid isPermaLink="false">http://freecodesnippet.com/articles/visual-basic-6/html-color-picker/</guid>
		<description><![CDATA[Choosing colors while making a website is a challenging job.
If you are not a natural designer, designing is the hardest job for you.
If you are a designer however, you provably don&#8217;t know the pain suffered by programmers while trying to make a fair looking website. We want THE best but get THE worst, when we [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Choosing colors while making a website is a challenging job.</strong></p>
<p>If you are not a natural designer, designing is the hardest job for you.<br />
If you are a designer however, you provably don&#8217;t know the pain suffered by programmers while trying to make a fair looking website. We want THE best but get THE worst, when we try too hard <img src='http://freecodesnippet.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Anyway, if you are like me who ending up choosing ugly colors, 9 out of 10 times, then let me give you a suggestion. Don&#8217;t try too hard!<br />
If you have a friend, good at designing, have him do it for you. If not hire a designer.</p>
<p>But lets make this article a bit more fun, let me tell you plan &#8216;B&#8217;.<br />
Steal color from other websites <img src='http://freecodesnippet.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> , literally.<br />
How?<br />
Simple! use photoshop to grab color from other window or make your own color picking application. If you are too lazy open photoshop or make a color picking application, use mine.</p>
<p>A long time ago, I made this simple vb6 program. And still I use it daily (to steal colors of course) . It lets you, pick &amp; mix colors and give you appropriate HTML color value.<br />
The download link is given at the end if this article.</p>
<p>Here is a screen shot:</p>
<p style="text-align: center"><img src="http://freecodesnippet.com/wp-content/uploads/2007/09/htmlcolorpicker.gif" alt="htmlcolorpicker.gif" /></p>
<p>Ugly?<br />
What did you expect?</p>
<p><strong>To use it:</strong><br />
1) Select a color by moving the sliders, or pick one by dragging the eye-drop like icon at the top-right area of the window near the &#8216;Ok&#8217; button.<br />
2) Click on &#8216;Copy HTML&#8217; button, and that&#8217;s it! The corresponding HTML color code for the color seen on the preview box will be in your clipboard.<br />
3) Open your HTML editor, paste the color value.</p>
<p><strong>Download links:</strong><br />
-&gt;<a href="http://freecodesnippet.com/wp-content/uploads/2007/09/html-color-picker.zip" title="HTML color picker">HTML color picker, compiled executable file only (for windows)</a> - 79.0KB</p>
<p>-&gt;<a href="http://freecodesnippet.com/wp-content/uploads/2007/09/html-color-picker-src.zip" title="HTML color picker source code">Full VB6 Source code </a>(because fcs is all about programming) - 44.8KB</p>
<p>Want it on C++ or JAVA, if I get enough motivations, you&#8217;ll soon see two more links here.</p>
<p>And as usual, any suggestions? Question? drop em&#8217; all below.<a href="http://freecodesnippet.com/wp-content/uploads/2007/09/html-color-picker-exec.zip" title="HTML Color Picker"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://freecodesnippet.com/articles/visual-basic-6/html-color-picker/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.279 seconds -->
<!-- Cached page served by WP-Cache -->
