<?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>Dagon Design &#187; Miscellaneous</title>
	<atom:link href="http://www.dagondesign.com/topics/misc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dagondesign.com</link>
	<description>WordPress Plugins, PHP Scripts, Tools, and Tutorials</description>
	<lastBuildDate>Thu, 08 Oct 2009 00:17:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to install Palm Desktop on Windows XP 64</title>
		<link>http://www.dagondesign.com/articles/how-to-install-palm-desktop-on-windows-xp-64/</link>
		<comments>http://www.dagondesign.com/articles/how-to-install-palm-desktop-on-windows-xp-64/#comments</comments>
		<pubDate>Wed, 15 Mar 2006 02:32:43 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.dagondesign.com/articles/how-to-install-palm-desktop-on-windows-xp-64/</guid>
		<description><![CDATA[If you use the 64 bit version of Windows, and have a Palm handheld, you probably already know that Palm does not support this setup. Palm has no immediate plans to support the 64 bit version of Windows, and there are no drivers that will work for the devices. The good news is that you [...]]]></description>
			<content:encoded><![CDATA[<p>If you use the 64 bit version of Windows, and have a Palm handheld, you probably already know that Palm does not support this setup. Palm has no immediate plans to support the 64 bit version of Windows, and there are no drivers that will work for the devices. The good news is that you can still use your device by hotsyncing with WiFi or Bluetooth. The bad news is that you cannot install the Palm Desktop software. At least not without a simple work-around.<span id="more-61"></span></p>
<p>There is another method for this floating around the internet, but I (and several others) have had very limited success. </p>
<p>After trying quite a few different things, I came up with the method below. It works perfect for me every time, unlike the other method out there.</p>
<h3>UPDATE</h3>
<p>: The newer versions of the Palm Desktop software seem to install properly on XP 64 with no issues, so try that first before you follow the steps below.</p>
<h3>Instructions</h3>
<p><strong>1)</strong> Start > Run > <strong>msiexec /unregister </strong></p>
<p><strong>2)</strong> In regedit, find the following key:<br />
<strong>HKEY_LOCAL_MACHINE\<br />
SOFTWARE\Microsoft\Windows\CurrentVersion\Installer </strong></p>
<p><strong>3)</strong> Change <strong>MsiExecCA64</strong><br />
From this: <strong>C:\WINDOWS\system32\msiexec.exe</strong><br />
To this: <strong>C:\WINDOWS\SysWOW64\msiexec.exe </strong></p>
<p><em>(This assumes a default Windows directory.<br />
Change to reflect your configuration if needed.)</em></p>
<p><strong>4)</strong> Restart the Windows Installer service<br />
(Control Panel > Administrative Tools > Services)</p>
<p><strong>5)</strong> Install Palm Desktop! </p>
<p>To go back to the previous settings, just reverse the change made in the registry, and stop/start the service again. </p>
<p>You can also set it back to normal by re-registering the installer:<br />
Start > Run > <strong>msiexec /unregister</strong><br />
Start > Run > <strong>msiexec /register </strong></p>
<h3>Conclusion</h3>
<p>I cannot claim any responsibility if you make a mistake and corrupt your system. To play it safe, make sure you have system restore enabled, so you can easily go back if there is a problem.</p>
<p>Let me know how it works for you!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagondesign.com/articles/how-to-install-palm-desktop-on-windows-xp-64/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>Turning MP3 audiobooks into iPod audiobooks</title>
		<link>http://www.dagondesign.com/articles/turning-mp3-audiobooks-into-ipod-audiobooks/</link>
		<comments>http://www.dagondesign.com/articles/turning-mp3-audiobooks-into-ipod-audiobooks/#comments</comments>
		<pubDate>Wed, 09 Nov 2005 05:10:14 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.dagondesign.com/?p=34</guid>
		<description><![CDATA[The best feature of the iPod&#8217;s audiobook format is the ability to resume playback at a particular point even if you play something else or turn the iPod off. There are many online services where you can obtain audiobooks, but most of them are in MP3, which the iPod just treats as regular music. With [...]]]></description>
			<content:encoded><![CDATA[<p>The best feature of the iPod&#8217;s audiobook format is the ability to resume playback at a particular point even if you play something else or turn the iPod off. There are many online services where you can obtain audiobooks, but most of them are in MP3, which the iPod just treats as regular music. With a few steps, it is easy to convert MP3 files (or any other filetype that iTunes can play) into the native iPod audiobook format. There are a lot of different methods out there, but the following steps work nicely for me. <span id="more-34"></span></p>
<h3>Notice</h3>
<p>If you are using iTunes 8.1 or newer, there is now a built-in feature to designate regular mp3 files as audiobooks, so these instructions are not needed.</p>
<h3>Before you begin</h3>
<p>For best results, you should not upload audiobooks that are larger than 320MB or longer than 5 hours. This can cause playback and stability problems. If you have files larger than this, splitting them up into smaller parts is recommended.</p>
<p>Most audiobooks that you download will be in multiple files. I personally like combining these into a single file so I do not have to remember which file I am listening to. It also keeps the audiobooks menu on my iPod much easier to read. I simply let the iPod remember my position in the audiobook when I come back to it. It is just personal preference.</p>
<p>Most audiobooks will be far less than 320MB and 5 hours long, so if you want, you can combine your MP3s into a single file before you begin. <a href="/files/mp3merger-0321.zip">MP3 Merger</a> is a great freeware program.</p>
<h3>Configuring iTunes</h3>
<p>Before you convert the files, iTunes must be set properly. You should only have to do this once. In the iTunes menu (I am using version 6), select the following:</p>
<blockquote><p>Edit > Preferences > Advanced > Importing</p></blockquote>
<p>Make sure &#8220;<strong>Import Using</strong>&#8221; is set as &#8220;<strong>AAC Encoder</strong>&#8220;.</p>
<p>Change &#8220;<strong>Setting</strong>&#8221; to &#8220;<strong>Custom</strong>&#8221; and set the following options:</p>
<blockquote><p><strong>Bit Rate:</strong> 64kbs <em>(this is a nice average setting for most audiobooks)</em><br />
<strong>Channels: </strong>Stereo <em>(fixes an issue with homemade mono files on some iPods)</em><br />
Check &#8220;<strong>Optimize for Voice</strong>&#8220;</p></blockquote>
<h3>Instructions</h3>
<p>Add the files you want to convert to your library. Once they are there, select the file(s), right-click, and select &#8220;<strong>Convert Selection to AAC</strong>&#8220;. This will add the newly converted files to your library.</p>
<p>Once the conversion is complete, remove the original files from your library. They will no longer be needed for this process.</p>
<p>You can also remove the newly created files from your library, but when you are asked, be sure to select &#8220;<strong>Keep Files</strong>&#8220;, so they are not deleted off your hard drive. </p>
<p>The files are created under &#8220;<strong>My Documents\My Music\iTunes\iTunes Music</strong>&#8221; <em>(unless you told iTunes otherwise)</em>, so open up that folder.</p>
<p>You will notice that the new files have the <strong>.m4a</strong> extension. They must be renamed to <strong>.m4b</strong>.</p>
<p>Now that the files are renamed, you can add them to your iTunes library once again.</p>
<p>Right-click on the new file(s) in your library and select &#8220;<strong>Get Info</strong>&#8220;. </p>
<p>You can change the name of the file(s) on this screen. If you like, you can clear out the &#8220;artist&#8221; and &#8220;album&#8221; fields, so that they do not show up with the rest of your music on the iPod (when you are looking at albums or artists). They will still show up under &#8220;audiobooks&#8221; of course.</p>
<p>You can also change the genre of the files to &#8220;<strong>Audiobooks</strong>&#8221; using the iTunes tag editor, to make the files easier to find when looking through iTunes.</p>
<p>All you have to do now is add the files to your iPod. They should work just like any iTunes audiobook. They will show up under the &#8220;Audiobooks&#8221; menu on your iPod, your playback position will be remembered, and they will not get played during song shuffles.</p>
<h3>Conclusion</h3>
<p>I take no responsibility if you mess anything up, but as long as you follow these steps, it should work fine.</p>
<p>I have a fourth generation iPod. While this method works great for me, I cannot promise that it will work for all revisions. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagondesign.com/articles/turning-mp3-audiobooks-into-ipod-audiobooks/feed/</wfw:commentRss>
		<slash:comments>177</slash:comments>
		</item>
		<item>
		<title>Writing Secure PHP Scripts &#8211; Part 1</title>
		<link>http://www.dagondesign.com/articles/writing-secure-php-scripts-part-1/</link>
		<comments>http://www.dagondesign.com/articles/writing-secure-php-scripts-part-1/#comments</comments>
		<pubDate>Mon, 17 Oct 2005 16:45:55 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.dagondesign.com/articles/writing-secure-php-scripts-part-1/</guid>
		<description><![CDATA[The most important element of any PHP script is security. In this article I will be discussing several methods of securing variables in PHP, with special regard to user input. While it is impossible to cover everything in a single article, my goal is to cover a range of topics, focusing on the most common [...]]]></description>
			<content:encoded><![CDATA[<p>The most important element of any PHP script is security. In this article I will be discussing several methods of securing variables in PHP, with special regard to user input. While it is impossible to cover everything in a single article, my goal is to cover a range of topics, focusing on the most common security mistakes and how to fix them. This is aimed at those fairly new to PHP, but perhaps it will give others a few new ideas as well. <span id="more-32"></span></p>
<h3>Securing your variables</h3>
<p>In most versions of PHP, you can access the value of a variable before it is initialized. Consider this simple example:</p>
<pre>if ($password == $the_password) {
&nbsp;&nbsp;&nbsp;&nbsp;$logged_in = 1;
}
if ($logged_in == 1) {
&nbsp;&nbsp;&nbsp;&nbsp;// secure stuff
}</pre>
<p>All a visitor has to do is add <strong>?logged_in=1</strong> to the end of the URL and they will have access. While this may seem obvious, it is an extremely common problem with PHP scripts.</p>
<p>The best way to prevent this is to always make sure variables are declared before they are used. For this example, you can just add the following line at the top of the file:</p>
<pre>$logged_in = 0;</pre>
<p>Now the variable cannot be reset by a user since it is being declared before use.</p>
<p>Another recommendation is to enable error reporting. With the right setting, your scripts will generate an error if a variable is used before it is defined. While this might sound bothersome, it can be quite helpful for keeping things secure, since it will let you know of any variables you missed.</p>
<p>You can enable this for your entire server with a line in php.ini:</p>
<pre>error_reporting = E_ALL</pre>
<p>To enable this for a particular PHP script, just add this to the top of the file:</p>
<pre>error_reporting(E_ALL);</pre>
<p>If you do enable error reporting in your php.ini, but need it bypassed for a particular script, you can use this in your file:</p>
<pre>error_reporting(0);</pre>
<h3>Variables passed to the script</h3>
<p>On most servers, a visitor can put a variable in the URL which then gets turned into a variable in the script. There will be many times when you need information passed to the script in this manner, but only if you are asking for it. That is where the superglobals come in.</p>
<p>There are two superglobals which you will be using most of the time. <strong>$_GET</strong> and <strong>$_POST</strong>. <strong>$_GET</strong> is used to retrieve variables passed in the URL. <strong>$_POST</strong> is used to get values from html forms. In the past, you also had <strong>$HTTP_POST</strong> and <strong>$GET_VARS</strong> but they are depreciated and should not be used. Here is an example:</p>
<pre>$the_name = $_GET[&#039;name&#039;];</pre>
<p>Keep in mind however that you need to make sure the value exists in the superglobal array before you use it, or you may receive an error. Try this:</p>
<pre>if (isset($_GET[&#039;name&#039;])) {
&nbsp;&nbsp;&nbsp;&nbsp;$the_name = $_GET[&#039;name&#039;];
} else {
&nbsp;&nbsp;&nbsp;&nbsp;$the_name = &quot;&quot;;
}</pre>
<p>Now that you know how to get input from the user properly, there is still the matter of someone being able to pass random variables to your script. This is easy to fix with the <strong>register_globals</strong> option of PHP.</p>
<p>In your php.ini file, add this line:</p>
<pre>register_globals = Off</pre>
<p>Or in an .htaccess file:</p>
<pre>php_flag register_globals off</pre>
<p>Once again, if you need to re-enable register_globals for a particular script, you can do so with an alternate .htaccess file.</p>
<p>With register_globals disabled, the only way you will be able to accept user input is with the superglobals. Parameters passed to the script will no longer be automatically turned into variables.</p>
<h3>Never trust the user</h3>
<p>No matter what kind of input you are expecting, or what it will be used for, always validate it!</p>
<p>Even if you have a form textfield with a max length of 10 characters, you still need to make sure that the input is the proper size, because it is easy to bypass the very basic restrictions of html forms. It is even easy to send a multi-line input into a single-line textfield if you know what you are doing.</p>
<p>If you are displaying user input on the page, you must convert html characters to their browser-safe versions, so that the user does not cause code to execute on your server.</p>
<p>If you are putting user input into a MySql query you must use regular expressions to make sure the data is in the format you want, and then escape it with <strong>mysql_real_escape_string</strong>. Otherwise it can be very easy for someone to enter in a string of characters which can do very bad things to your database.</p>
<p>Here is a simple function which takes user input and makes it safe to display on the page. First it replaces any special html characters with their safe character codes. Then it checks magic quotes (to see if slashes were automatically added on input), and strips them if needed.</p>
<pre>function fix_for_page($value){
&nbsp;&nbsp;&nbsp;&nbsp;$value = htmlspecialchars(trim($value));
&nbsp;&nbsp;&nbsp;&nbsp;if (get_magic_quotes_gpc()) 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$value = stripslashes($value);
&nbsp;&nbsp;&nbsp;&nbsp;return $value;
}</pre>
<p>Magic quotes was created to make it easier for new PHP programmers to use user input. It automatically adds slashes when needed, but the problem is that it can cause even more confusion. This is why you need to first check to see if it is enabled, and process it accordingly.</p>
<p>This next function takes user input and makes it safe for use in a MySql query. It does this by stripping slashes (if needed), then using the <strong>mysql_real_escape_string</strong> function.</p>
<pre>function fix_for_mysql($value){
&nbsp;&nbsp;&nbsp;&nbsp;if (get_magic_quotes_gpc())
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$value = stripslashes($value);
&nbsp;&nbsp;&nbsp;&nbsp;$value = mysql_real_escape_string($value);
&nbsp;&nbsp;&nbsp;&nbsp;return $value;
}</pre>
<p>It is a common belief that whether you are displaying user input on the screen, or using it in a query, the characters you need to escape are the same, but this is not true. That is why there are seperate functions. If you give data to a query that has only been checked using the standard special character and escape functions, there is still a chance for an exploit. Always use the proper safeguards.</p>
<h3>Other uses of user input</h3>
<p>Anytime you are including a file in your script, and the filename has been given by the user, you must be very careful. Imagine having this on your page:</p>
<pre>&lt;a href=&quot;template.php?the_file=section1.php&quot;&gt;Section 1&lt;/a&gt;
&lt;a href=&quot;template.php?the_file=section2.php&quot;&gt;Section 2&lt;/a&gt;
&lt;a href=&quot;template.php?the_file=section3.php&quot;&gt;Section 3&lt;/a&gt;</pre>
<p>After looking at that code, a user might try to see if they can use the script to open some other file on the server, such as a configuration file with passwords. Since such a large number of scripts are insecure, there is a good chance that they would be able to. There are some good ways to deal with this though.</p>
<p>If you are working with a small number of files, you can always just make sure the input matches one of the options exactly, like this:</p>
<pre>$pages = array(&#039;section1.php&#039;, &#039;section2.php&#039;, &#039;section3.php&#039;); 
if (in_array($the_file, $pages) ) { 
&nbsp;&nbsp;&nbsp;&nbsp;include($the_file); 
} else { 
&nbsp;&nbsp;&nbsp;&nbsp;die(&quot;Invalid File!&quot;); 
} </pre>
<p>Now if you have a lot of files, and they share a common naming system, you can use regular expressions to make sure the specified file name fits the naming scheme.</p>
<p>One other solution is to create a directory which contains the files, and only let the script open files in that directory. First, be sure to strip out any extra slashes in the user input, so that way the filename cannot be referencing another directory. Then hard-code the path like so:</p>
<pre>$filename = &quot;/data/&quot; . $the_file;</pre>
<p>That is a very basic example, but you get the idea. If you do not check for extra slashes, someone could try to open something like &#8220;<strong>../../../config.php</strong>&#8220;.</p>
<p>It is also a good idea to always use the <strong>.php</strong> extension for included files. That way, even if one gets opened in the browser directly, the code (data, passwords, etc..) will not be visible since PHP is processed on the server side.</p>
<h3>PHP form mailers</h3>
<p>The most commonly exploited PHP script is perhaps the form mailer. It is very rare to find one out there that does not have security holes. Many think that because the recipient&#8217;s name is hard-coded in the script, there is no way to use it to send mail to other people. This is completely false!</p>
<p>The most common way to exploit form mailers is through the injection of alternate email headers. Here is a very simple example. Imagine someone typing this in for the email subject:</p>
<pre>Buy My Stuff!\\nBcc: someone_getting_spammed@domain.com</pre>
<p>As you can see, a new header was injected into the message, causing a copy of the email to go somewhere else. Once again, this is an extremely simple example, as there are many other ways to inject email headers. Now that you are aware of the problem, you can take steps to fix it.</p>
<p>By now you know to always validate your data. After that step, you can do a simple check on your fields to make sure multiple lines were not added. Try this:</p>
<pre>$from = $_POST[&quot;sender&quot;];
if (eregi(&quot;\\r&quot;,$from) || eregi(&quot;\\n&quot;,$from)) {
&nbsp;&nbsp;&nbsp;&nbsp;die(&quot;Invalid Input!&quot;);
}</pre>
<p>You will need to perform this check on all of the fields (except the actual message). This is just one method. If you wanted, you could also strip out any colons from the fields since they are needed for headers. </p>
<p>You only really need to worry about this on your Name, Email, Subject, etc.. fields. The message itself is not as important (assuming you are using the mail function properly) since it is not put in the headers, but rather below them.</p>
<p>One alternative would be to have a field for the message and that&#8217;s it. Then no headers could get injected. Or you could still have the fields, but instead of putting the user input in the headers, it could just put it in the message itself.</p>
<p>There is much more to say about form mailer scripts, but that is all I will cover here. I will soon be writing an article focusing completely on PHP form mailers, which will include my personal script.</p>
<h3>Conclusion</h3>
<p>That concludes the first part of this article. Questions and/or comments are welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagondesign.com/articles/writing-secure-php-scripts-part-1/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>How To Add Ringtones To The Samsung VGA1000 / SPH-A620</title>
		<link>http://www.dagondesign.com/articles/how-to-add-ringtones-to-the-samsung-vga1000-sph-a620/</link>
		<comments>http://www.dagondesign.com/articles/how-to-add-ringtones-to-the-samsung-vga1000-sph-a620/#comments</comments>
		<pubDate>Tue, 07 Jun 2005 20:42:53 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.dagondesign.com/?p=24</guid>
		<description><![CDATA[This article explains how to add ringtones to your Samsung VGA1000 / SPH-A620 phone without using the Vision service from Sprint. All it requires is some software (such as BitPim and GCDCreator), and the USB cable for your phone.]]></description>
			<content:encoded><![CDATA[<p>This article explains how to add ringtones to your Samsung VGA1000 / SPH-A620 phone without using the Vision service from Sprint. All it requires is some software (such as BitPim and GCDCreator), and the USB cable for your phone.<span id="more-24"></span></p>
<p><img class="alignright" src='/uploads/samsungspha620.gif' alt='Samsung VGA1000 / SPH-A620' /> </p>
<p><strong>Major Update!</strong> &#8211; The previous method on this site would only let you add new ringtones by replacing ones you already had on your phone. This means you would have to use the vision service at least once to get some uploaded. The solution has finally been discovered, and now you can upload new ringtones without having to replace old ones! This means you can upload ringtones without having to have any already on the phone!</p>
<h3>Page Contents</h3>
<ul>
<li><a href="#introduction">Introduction</a> &#8211; What does this tutorial explain? </li>
<li><a href="#tools">Tools Needed</a> &#8211; Programs you will need to upload your ringtones</li>
<li><a href="#drivers">USB Drivers</a> &#8211; NEW! USB drivers for Samsung phones </li>
<li><a href="#midi">Creating a ringtone from a MIDI file using GCDCreator</a> </li>
<li><a href="#mp3">Creating a ringtone from a WAV or MP3 file </a></li>
<li><a href="#uploading">Uploading the ringtone to your phone </a></li>
<li><a href="#comments">Comments</a> &#8211; Questions? Comments? Ask! </li>
</ul>
<h3><a name="introduction"></a>Introduction</h3>
<p>This document describes the process of adding ringtones to your  Samsung VGA1000 / SPH-A620 phone without using the Spring Vision service. These  instructions will allow you to add new ringtones, instead of having to replace ones you already have (as in the previous versions of this tutorial). And unlike the previous method, this will also show the correct song name in your phone.</p>
<h3><a name="tools"></a>Tools needed</h3>
<ul>
<li><strong>BitPim</strong> &#8211; <a href="http://bitpim.sourceforge.net/" target="_blank">http://bitpim.sourceforge.net/ </a><br />
Bitpim is a great open-source program which allows you to transfer files between your phone and computer. It actually has a built-in ringtone transfer feature, but it (like the rest of the features) does not work on every phone. Currently it does not support the VGA1000 / SPH-A620 which is why you are reading this! Luckily, the program does allow you to view and edit the file system of this phone. You also must have the appropriate cable to communicate with your phone. For BitPim related questions, check out their web site.
</li>
<li><strong>phaZed&#8217;s GCDCreator v1.1.0</strong> &#8211; <a href="http://www.sprintusers.com/downloads/gcdcreator/" target="_blank">http://www.sprintusers.com/downloads/gcdcreator/</a><br />
GCDCreator has a couple of useful features. First, it allows you to generate GCD files which are sort of like description files for objects on your phone. It lets the phone know what kind of file it has. The other notable feature of GCDCreator is its ability to convert a (properly formatted) WAV file into a QCP. The VGA1000 / SPH-A620 supports two types of ringtones. MIDI files (the same that your computer will play), and QCP, which is a low quality WAV. You can experiment with different songs to find ones that work well on your phone.</li>
<li><strong>Hexplorer</strong> &#8211; <a href="http://artemis.wszib.edu.pl/%7Emdudek/">http://artemis.wszib.edu.pl/~mdudek/</a><br />
Any hex-editor will work, but I personally like this one.</li>
<li><strong>Winamp and/or a sound editor</strong><br />
You only need these if you plan to create a ringtone from a WAV, MP3, or other audio file besides MIDI. </li>
</ul>
<h3><a name="drivers"></a>USB Drivers</h3>
<p>The following file contains the drivers for the Samsung A310, A530, A600, A620, A660, and a few other models, but this tutorial only covers the A620/VGA1000. You will need this driver so Windows will recognize your phone as a USB device, although most cables come with drivers already.</p>
<p><a href="http://www.dagondesign.com/files/Samsung_USB_Drivers.rar">Download Samsung_USB_Drivers.rar</a></p>
<h3><a name="midi"></a>Creating a ringtone from a MIDI file using GCDCreator</h3>
<p>First, open GCDCreator. You will notice that the interface is broken down into steps.</p>
<h4>Step 1</h4>
<p>Click the &#8220;New GCD&#8221; button and select your MIDI file</p>
<h4>Step2</h4>
<p>&#8216;MIDI&#8217; should already be selected. If not, select it. </p>
<h4>Step 3</h4>
<p>Choose your output directory. Then fill in the information for the GCD file. Below is an example. It is best to keep the Content-Name and URL unique. If you are using the latest version of GCDCreator, it will automatically give you a unique URL. You will notice below, it is just the file name, with a forward slash. </p>
<blockquote><p><strong>Content-Name: </strong>The Cure &#8211; Fascination Street<br />
<strong>Content-Version: </strong>1.0<br />
<strong>Content-Vendor:</strong> Dagon Design<br />
<strong>Content-URL:</strong> /the cure &#8211; fascination street.mid</p></blockquote>
<h4>Step 4</h4>
<p>Click the &#8220;Make GCD &#8221; button. That&#8217;s it! You are left with the MIDI and GCD files. </p>
<h3><a name="mp3"></a>Creating a ringtone from a WAV or MP3 file</h3>
<p>If you want to create a ringtone from a WAV or MP3, or any other kind of audio file, there are a few more steps. Using your favorite sound editor, you need to convert your file to a 8000hz 16bit MONO PCM WAV. I recommend cropping your sound file as well, or it might end up being too big for your phone. For best results, use a section that sounds good repeated.</p>
<p>For this example. I used an MP3 I had laying around. After converting it to a WAV with Winamp&#8217;s &#8220;disk writer&#8221; feature (which can also create the correct WAV format for you), I crop the first few seconds from it with Sound Forge (a sound file editor).</p>
<p>Now you need to convert the WAV to QCP. </p>
<h4>Step 1</h4>
<p>Click the &#8220;WAV to QCP&#8221; button. Select your WAV file and click &#8220;Convert WAV&#8221;. You now have a QCP file. You can delete the WAV if you want since we are through with it.</p>
<h4>Step 2</h4>
<p>Now you just have to create the GCD file for your new QCP file. This process is already explained in the above section, &#8220;Creating a ringtone from a MIDI file using GCDCreator&#8221;. The only difference is that you do not select &#8220;MIDI&#8221; in the second step, but rather the &#8220;QCELP Clips&#8221; option.</p>
<p>You should now have a QCP and GCD file. </p>
<h3><a name="uploading"></a>Uploading the ringtone to your phone</h3>
<p>Below are the steps you must take to add your new ringtones. Please follow them in order.</p>
<h4>Checking the current ringtones</h4>
<p>Before you know what to name your new ringtone files, you need to look in the /ams/Ringers/ directory of your phone. Here is an example listing: </p>
<blockquote><p>cnts1<br />
cnts1.gcd<br />
cnts2<br />
cnts2.gcd</p></blockquote>
<p>This means the next one will be number 3, so here is how you name your files: </p>
<h4>For MIDI</h4>
<blockquote><p>rename midi_file.mid to cnts3 (no extension!)<br />
rename midi_file.gcd to cnts3.gcd</p></blockquote>
<h4>For QCP (converted from WAV/MP3)</h4>
<blockquote><p>rename qcp_file.qcp to cnts3 (no extension!)<br />
rename qcp_file.gcd to cnts3.gcd</p></blockquote>
<p>We will upload them in a moment. There are a few steps first. </p>
<h4>Saving the registry</h4>
<p>Using the filesystem view in BitPim, browse to the <strong>/ams/</strong> directory and find the <strong>AmsRegistry </strong>file. Right-click the file and save it to your computer. I recommend keeping a backup copy of it somewhere safe in case something goes wrong. </p>
<h4>Editing the registry</h4>
<p>Using Hexplorer (or your favorite hex-editor), go to address <strong>9230</strong>. In Hexplorer you can do this from the menu at <em>&#8220;View -> Go To Address&#8221;</em>. You will see a two digit hex character. This represents how many applications, games, and ringers you have on your phone.</p>
<p>A new phone contains 2 sample applications, 3 sample games, and 0 ringers. This means the number should be 05. If you are adding two ringtones, this number should be set at 07, etc. For each ringtone you add, increase this number.</p>
<p>It is important to mention that this value is displayed in hexadecimal.</p>
<p>In hex, instead of <strong>0 to 9</strong>, it is: <strong>0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F</strong> (which equals <strong>0-15</strong>) </p>
<p>So in other words: <strong>0-15 is 00-0F </strong>&#8230; <strong>16-31 is 10-1F </strong>&#8230; <strong>32-47 is 20-2F </strong>&#8230;etc&#8230; Easy enough! </p>
<p>Once you have made the required change, save the file and exit your hex editor.</p>
<h4>Uploading files</h4>
<p>Once again, always perform the steps as they are listed:</p>
<ul>
<li>Upload the ringtone files into <strong>/ams/Ringers/</strong> </li>
<li>Upload the new <strong>AmsRegistry </strong>file into <strong>/ams/</strong> overwriting the old copy </li>
<li>Delete the <strong>EndTransaction </strong>file from <strong>/ams/</strong> </li>
</ul>
<h4>Finishing</h4>
<p>Disconnect your phone, and do a full power cycle. To do this, hold down your <strong>END </strong>button until the phone turns off. Then turn it back on. Check your <strong>Downloads </strong>section to see if your new ringers are there! If so, congratulations! </p>
<h4>Troubleshooting</h4>
<p>If you get a message stating that your <strong>AmsRegistry </strong>file is<strong> &#8220;locked&#8221;</strong> when trying to overwrite it, simply cycle the phones power and try again. You do not have to re-upload the ringtones if you already did this, but make sure the <strong>EndTransaction </strong>file is still gone. </p>
<p>If you cannot get this working, the first step is to make sure your ringtone files were created properly. This is the number one cause of problems! </p>
<h4>Important information about deleting ringtones </h4>
<p>If you want to delete a ringtone, do it through the phone, not through BitPim! This can cause serious problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagondesign.com/articles/how-to-add-ringtones-to-the-samsung-vga1000-sph-a620/feed/</wfw:commentRss>
		<slash:comments>179</slash:comments>
		</item>
		<item>
		<title>Animated Gifs from DVDs</title>
		<link>http://www.dagondesign.com/articles/animated-gifs-from-dvds/</link>
		<comments>http://www.dagondesign.com/articles/animated-gifs-from-dvds/#comments</comments>
		<pubDate>Sun, 05 Jun 2005 23:11:23 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.dagondesign.com/?p=22</guid>
		<description><![CDATA[This article describes my method of creating animated gif images from DVD movies. This technique is perhaps most useful when coming up with new avatars and signatures for forums. While animated gifs are not really useful for much else, they can be fun to make since you can learn a lot of new things as you experiment in Photoshop.]]></description>
			<content:encoded><![CDATA[<p>This article describes my method of creating animated gif images from DVD movies. This technique is perhaps most useful when coming up with new avatars and signatures for forums. While animated gifs are not really useful for much else, they can be fun to make since you can learn a lot of new things as you experiment in Photoshop.<span id="more-22"></span></p>
<h3>Requirements </h3>
<ul>
<li><strong>Photoshop / ImageReady</strong> &#8211; CS2 is preferred. </li>
<li><strong>PowerDVD</strong> &#8211; You can use any DVD playback software that can capture frames, but I find this one to be the best. The instructions below are for version 5.x. </li>
<li><strong>A DVD-Rom Drive</strong> &#8211; To play the DVDs in your PC. </li>
</ul>
<h3>Instructions</h3>
<p>Open up your DVD in PowerDVD. </p>
<p>In your configuration options, under &#8220;<em>Player Settings</em>&#8220;, click the &#8220;<em>Advanced</em>&#8221; button. Then select the &#8220;<em>Snapshot</em>&#8221; tab. Select the &#8220;<em>Capture to file</em>&#8221; radio button, and then choose the directory for your captures. Then exit the configuration. This is where the screen captures will be stored. </p>
<p>Now you can skip ahead in the movie to the scene you want to capture. Decide exactly which frame you want to start and end on. The shorter the better since animated gifs can get very large if you have a lot of frames. </p>
<p>Starting with the first frame, hit <strong>C</strong> to capture. Then hit <strong>T</strong> to move foward one frame. Repeat this process until you are at the end of the desired scene. </p>
<p>If you know ahead of time that you will end up with quite a few (several hundred) frames, you may want to only capture every other frame, or every third frame. You will just have to experiment to get the best results.</p>
<p>For this example, I am using a small scene from the SpongeBob SquarePants movie. I ended up capturing 27 frames. Now let&#8217;s open up ImageReady.</p>
<p>In the ImageReady menu, select &#8220;<em>File</em>&#8221; -> &#8220;<em>Import</em>&#8221; -> &#8220;<em>Folder as Frames</em>&#8221; and select the directory. </p>
<p><img src='/uploads/animatedgifsdvdstransfer.jpg' alt='Transfer Image to ImageReady' class="alignright"/> This will create a new file, where each frame is in it&#8217;s own layer. Now we need to transfer this to Photoshop. The best way is to simply click the bottom button on the main toolbar (shown in green in the image to the right). This transfers the currently active file directly to ImageReady (or back to Photoshop if you are already in ImageReady).</p>
<p>It is worth mentioning that you should save your files often, because you don&#8217;t want to have to start all over if you make a little mistake with the project.</p>
<p>Now you can crop and resize your frames. Since each frame is on its own layer, any resizing you do in photoshop will affect all the frames, which is much easier than repeating the same steps over and over, or setting up a macro. After resizing, here is my first frame (layer) from the PSD file:</p>
<div align="center"><img src='/uploads/animatedgifsdvdsfirst.jpg' alt='The First Frame' /> </div>
<p>If you like, you can add special effects, fonts, textures, brushes, etc. This must be done on a new layer (or layers) so that it can be applied to all of the frames in the following step. Be sure to put these new layers above the others. I created 2 new layers for this example. One for some text, and one for a border:</p>
<div align="center"><img src='/uploads/animatedgifsdvdseffects.jpg' alt='Effects Added To First Frame' /> </div>
<p>Now your layers list should look something like this:</p>
<div align="center"><img src='/uploads/animatedgifsdvdslayers.jpg' alt='Layers List' /> </div>
<p>There are of course several other frames down below that are not visible. Now that that&#8217;s done, click the toolbar option to transfer this back to ImageReady. </p>
<p>Take a look at the animation window near the bottom of ImageReady. If this is not already visible, select <em>&#8220;Window&#8221; -> &#8220;Animation&#8221;</em> from the menu to display it. </p>
<div align="center"><img src='/uploads/animatedgifsdvdsanimate.jpg' alt='Animation Window' /> </div>
<p>The far left frame is the first one in the animation. Highlight it. Now you must select (make visible) the layers you want shown on this frame. This means you want the first captured frame (the very bottom layer), and the special effects layers visible. Everything else should be hidden. (Click the little eye next to the layer to hide/unhide it). </p>
<p>Now move on to the second frame. The only thing you want visible for this one is the special effects stuff, and the second frame from the capture. </p>
<p>Just continue this process for each frame. This part can be time consuming, but depending on how everything was done, a lot of the frames will already be set properly. </p>
<p>Once you are through with this, you can click the play button near the bottom of the animation window. This will show you a preview of the animated gif. If you see any errors (like frames jumping in the middle), you probably did not set a frame correctly. </p>
<p>You can also adjust the time each frame is shown with the little drop down menus under the frame display. Or if you decide that you have too many frames, you can delete them directly from the animation window (the trash can icon).</p>
<p>Now go to <em>&#8220;File&#8221; -> &#8220;Save Optimized As&#8221;</em>, and give it a name. You now have an animated image. Here is mine:  </p>
<div align="center"><img src='/uploads/animatedgifsdvdsfinal.gif' alt='Final Image' /> </div>
<p>As you can see, this is an extremely basic example and it does not look that great, but it is easy to imagine the possibilities.</p>
<h3>Final Thoughts</h3>
<p>To make smoother animations you can take the frames you have, duplicate them, and then reverse. For example, say your frames are numbered 1-2-3-4-5. Try using them like this: 1-2-3-4-5-4-3-2. Now there will be a smooth transition, with no big jumps each time the animation is looped. This of course depends on the specific animation in the file, but once again, you can experiment.</p>
<p>There are many other things you can do, but this guide is simply meant to get you started. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagondesign.com/articles/animated-gifs-from-dvds/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Hotlink Protection with .htaccess</title>
		<link>http://www.dagondesign.com/articles/hotlink-protection-with-htaccess/</link>
		<comments>http://www.dagondesign.com/articles/hotlink-protection-with-htaccess/#comments</comments>
		<pubDate>Sat, 04 Jun 2005 23:10:27 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.dagondesign.com/articles/hotlink-protection-with-htaccess/</guid>
		<description><![CDATA[If you host a website, you have most likely been the victim of hotlinking at one time or another. Hotlinking is when someone displays your images (or other media) on their website by directly linking to your server. This means they get to display your files while your bandwidth is being used. Luckily, it is easy to prevent with the help of the .htaccess file. This article will show some of the better methods to use to stop hotlinking while keeping your server running smoothly.]]></description>
			<content:encoded><![CDATA[<p>If you host a website, you have most likely been the victim of hotlinking at one time or another. Hotlinking is when someone displays your images (or other media) on their website by directly linking to your server. This means they get to display your files while your bandwidth is being used. Luckily, it is easy to prevent with the help of the .htaccess file. This article will show some of the better methods to use to stop hotlinking while keeping your server running smoothly.<span id="more-15"></span></p>
<h3>An example</h3>
<p>Once someone found a large image on my site that they thought would make a good avatar on their forum. They linked to my server for the image, and even though it was shrunk down on the forum pages, it was still downloading the full size (over 200KB). This person had a lot of posts and it was a very heavily used forum. It ended up using about 100 Megs a day of bandwidth, or about 3 Gigs a month! That was when I decided to start using hotlink prevention.</p>
<h3>Requirements</h3>
<p>This article covers hotlink protection for the Apache web server. If you are running IIS, much the same can be accomplished using commercial software such as <a href="http://www.isapirewrite.com/">ISAPI Rewrite</a>.</p>
<p>You may have to contact your hosting service or just experiment to see if you are able to use the .htaccess file. The .htaccess file is simply a text file which contains directives (configuration settings) for the Apache web server. It is easy to create if you do not have one already, and it is generally located in the root directory of your server. Any settings in this file will apply to all sub-directories (unless told otherwise â€“ more on that later).</p>
<p>If you prefer to use the primary Apache configuration file (httpd.conf) for your server settings, everything in this tutorial can be accomplished much the same way.</p>
<h3>A few notes on the code</h3>
<p>This article will cover the two main methods of hotlink prevention: Image replacement and â€˜<em>403 Forbidden</em>â€™ responses. You may have seen hotlink protection code which redirects users to a specified web page, but this will most certainly not work . This is the equivalent of placing a URL into an &lt;img&gt; tag, and it will do nothing more than cause problems.</p>
<p>If you want hotlinks to take visitors to your site, it is best to simply return a â€˜<em>403 Forbidden</em>â€™ response and create nice custom error pages. A standard error page will generally just cause the visitor to close the window, but a well-made custom error page can give the visitor information about the site, and links to the main sections. They will be much more likely to visit your site because of this.</p>
<p>Explanations of the code samples are given below, as well as some basic information on flags and other options. For a full explanation of everything you can do with the .htaccess file, I recommend taking a look at the <a href="http://httpd.apache.org/docs/mod/directives.html">Apache directive documentation</a>.</p>
<h3>Proper image replacement method</h3>
<p>This method displays a specified image on the hotlinkerâ€™s page no matter what image they linked to. You can have a simple image which says â€œdo not hotlink!â€ or you can use your imagination and really discourage them! Read further to find out the best way to create these files.</p>
<pre>
RewriteEngine on 
RewriteCond %{HTTP_REFERER} . 
RewriteCond %{HTTP_REFERER} !^http://(www\\.)?yoursite\\.com [NC] 
RewriteRule \\.(gif|jpe?g)$ /images/hotlink.$1 [L]
</pre>
<h3>Breakdown of the code</h3>
<pre>
RewriteEngine on
</pre>
<p>This turns on the mod_rewrite engine in Apache. A requirement for the rewrite commands.</p>
<pre>
RewriteCond %{HTTP_REFERER} .
</pre>
<p>This line allows blank referrers. The period in .htaccess means â€˜any characterâ€™. This means users can manually type in a link to one of your images in their browser, but this is generally not even a problem. If you leave this line out a large percentage of visitors will not see your images. This includes many users behind corporate and ISP firewalls, all AOL users, and many others. Leaving this line in is highly recommended! If a visitor thinks your site is broken, they will most likely not return. If you have any kind of e-commerce site, they probably wonâ€™t be doing business with you!</p>
<pre>
RewriteCond %{HTTP_REFERER} !^http://(www\\.)?yoursite\\.com [NC]
</pre>
<p>Here the server checks to see if the request is coming from your own domain. Just change the text to match your website. It handles hotlink prevention whether or not the â€˜wwwâ€™ prefix is used. The <strong>[NC]</strong> flag at the end means â€˜No Caseâ€™, so it will handle everything.</p>
<p>Notice that there is a backslash before the periods in the domain name. As stated above, in the .htaccess file a period means â€˜any characterâ€™. Preceeding it with a backslash turns it into a literal period, meaning that there must actually be a period there. When writing .htaccess code it is always best to take all possibilities into consideration.</p>
<p>If you have another site that needs to hotlink from this one, simply duplicate this line and type in the new domain.</p>
<pre>
RewriteRule \\.(gif|jpe?g)$ /images/hotlink.$1 [L]
</pre>
<p>This last line blocks all requests for gif, jpg, and jpeg files unless they are from an allowed resource. You will notice the <strong>hotlink.$1</strong> file. This code will cause the server to return the proper type of file &#8211; which is the format that was requested. A lot of hotlink protection code simply sends one type of file no matter what, but many browsers will not handle this properly, and the above method provides the most flexibility while doing things correctly.</p>
<p>This means that for this example we need to create a hotlink.gif, hotlink.jpg, and hotlink.jpeg. Just create your replacement image, and export it to each of the needed file types. Then just upload them to your server in the location specified by the code (in this case &#8211; /images/). You can make the replacement images as large or as small as you want, just keep in mind that if they are too large, you may end up loosing more bandwidth than you would have without protection code!</p>
<h3>Proper â€˜403 Forbiddenâ€™ method</h3>
<p>This method is my favorite because it is the easiest on the server and no bandwidth is used at all. Once again, there are several methods to just return â€˜nothingâ€™ but generating a â€˜<em>403 Forbidden</em>â€™ error for the hotlinker is perhaps the best. It will not cause any errors or confusion on your server, and the hotlinker will be left with a broken image link.</p>
<pre>
RewriteEngine on
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://(www\\.)?yoursite\\.com [NC]
RewriteRule \\.(gif|jpe?g)$ - [NC,F]
</pre>
<h3>Breakdown of the code</h3>
<p>The last line is the only difference in these two examples, and this one just contains a dash where the image file would be. Since we are just bouncing back a â€˜<em>403 Forbidden</em>â€™ error message to the hotlinker we do not have to worry about creating any image files.</p>
<p>As mentioned before, if the hotlinkers have simple links to your images (as opposed to images displayed with the &lt;img&gt; tags), clicking on the links will return a â€˜<em>403 Forbidden</em>â€™ error with this method. This is what we want, but there is no reason you cannot create custom error pages which give the user information about your site and links to the main sections. This gives you a much better chance of keeping these visitors!</p>
<h3>Changing the blocked extensions</h3>
<p>For other extensions to be blocked, you just have to add them between the parenthesis, placing a <strong>|</strong> (pipe) character between each one. In the case of the jpg and jpeg files, there is only one entry, but the question mark after the â€˜eâ€™ means it is optional, so it handles both.</p>
<h3>Troubleshooting</h3>
<p>The most important thing to remember when testing hotlink protection code is that you must always clear your browserâ€™s cache before each test, or you may just be pulling up cached copies of the test images.</p>
<p>Another important thing to mention is that in many server configurations, mod_rewrite requires that either the <strong>FollowSymlinks </strong>or <strong>SymLinksIfOwnerMatch </strong>option is enabled. If your server requires this and you do not have it, you will get a â€˜<em>403 Forbidden</em>â€™ response for all requests. It should be easy to notice in your log files. If you do need it, simply add this line before your hotlink prevention code:</p>
<pre>Options +FollowSymLinks</pre>
<h3>Allow selective hotlinking</h3>
<p>There are a couple of different ways to do this. You can of course add the domain name that you want to allow into your .htaccess file as mentioned above, but what about when you have certain images you want anyone to use? Here is the solution I prefer.</p>
<p>Create a directory on your server called <strong>â€™shareâ€™ </strong>and create a new .htaccess file inside it, containing this code:</p>
<pre>RewriteEngine off</pre>
<p>This will counter-act the global .htaccess file, and allow hotlinking from this directory. Now you can keep your bandwidth protected while still letting certain files be hotlinked!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagondesign.com/articles/hotlink-protection-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Introduction to .htaccess</title>
		<link>http://www.dagondesign.com/articles/introduction-to-htaccess/</link>
		<comments>http://www.dagondesign.com/articles/introduction-to-htaccess/#comments</comments>
		<pubDate>Sat, 04 Jun 2005 23:06:39 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.dagondesign.com/articles/introduction-to-htaccess/</guid>
		<description><![CDATA[The .htaccess file is simply a text file containing directives (configuration settings) for the Apache web server. It allows you to control the behavior of your server and has an incredible number of uses. Many of the tutorials on this site involve the use of the .htaccess file and this article will give a bit more information for those of you who have no previous experience with it.]]></description>
			<content:encoded><![CDATA[<p>The .htaccess file is simply a text file containing directives (configuration settings) for the Apache web server. It allows you to control the behavior of your server and has an incredible number of uses. Many of the tutorials on this site involve the use of the .htaccess file and this article will give a bit more information for those of you who have no previous experience with it. <span id="more-14"></span></p>
<h3>Requirements</h3>
<p>As stated above, the .htaccess file contains directives for the Apache web server. If you are running IIS then you can achieve much of the same functionality with commercial applications such as <a href="http://www.isapirewrite.com/">ISAPI Rewrite</a>, but that will not be covered here. </p>
<p>If you are not sure what software your web server uses, or if you even have access to the .htaccess file, you can simply ask your hosting company.</p>
<h3>Location</h3>
<p>An .htaccess file can be placed in any directory on your web server and there is no standard limit on how many instances of it you can have. The directives in each file apply to all the files and directories beneath, unless told otherwise. This means that you can have one global .htaccess in your root directory and a separate .htaccess in a specific directory which counter-acts the global settings.</p>
<h3>Creation</h3>
<p>Before you create the file, it is best to check to see if you already have one on your server. If so, it may contain important code that you do not want to loose. Be sure to back it up before making changes.</p>
<p>Many FTP clients will hide the .htaccess file by default, so you may need to check your settings to see if there is an option to display hidden files. In Windows, I personally like using <a href="http://www.cuteftp.com/">CuteFTP</a>.</p>
<p>Remember that the .htaccess file is a simple text file. This means you can create it in any standard text editor such as Notepad. </p>
<p>If you are running the Windows operating system, you are not allowed to save a file without a prefix (the text before the period). This means you must name your file something else (such as htaccess.txt) and then rename it with your FTP client after it has been uploaded.</p>
<p>When uploading the .htaccess file, be sure that your FTP client is set to use ASCII (text) mode. This will prevent any formatting problems due to the transfer.</p>
<h3>Other tips</h3>
<p>Any line starting with a â€˜<strong>#</strong>â€˜ (pound sign) is ignored (useful for adding comments to your code).</p>
<p>When I mentioned the root directory as the location for your primary .htaccess file, I am referring to the root directory for your html files. This is not necessarily the directory you start with when you connect using your FTP client. Most users will have a â€˜public_htmlâ€™ directory (or something similar) which is the true root of your web site.</p>
<p>Most .htaccess directives must be placed on a single line. If you are dealing with long lines of code, make sure word-wrap is turned off in your text editor to prevent problems.</p>
<h3>Security</h3>
<p>If you wish to keep your .htaccess file fully secure, I recommend using both of the following methods:</p>
<p>1) Add the following code into the start of your .htaccess file. It will send a â€˜403 Forbiddenâ€™ response to anyone trying to access it.</p>
<pre>&lt;files .htaccess&gt;
order allow,deny
deny from all
&lt;/files&gt;</pre>
<p>2) Be sure to set your .htaccess file to <strong>644 </strong>(RW-Râ€“Râ€“) with <strong>CHMOD</strong>. This sets the proper file permissions. Many FTP clients allow you to set this in the properties of the file.</p>
<h3>Troubleshooting</h3>
<p>Always make sure your code is typed in properly!</p>
<p>It is very easy to cause problems with the .htaccess file. Even an extra character somewhere can bring down your site, or start an infinite loop. Generally this will not affect the other services (such as FTP), so you can easily get in and reverse your settings. Error logs can also be a great help when troubleshooting code.</p>
<h3>Conclusion</h3>
<p>Now that you know a bit more about the .htaccess file, feel free to take a look at some of the tutorials on this site that deal with its use. </p>
<p>If you want a fully detailed listing of all the available directives, you can check out the <a href="http://httpd.apache.org/docs/mod/directives.html">Apache directive documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagondesign.com/articles/introduction-to-htaccess/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Custom Error Pages</title>
		<link>http://www.dagondesign.com/articles/custom-error-pages/</link>
		<comments>http://www.dagondesign.com/articles/custom-error-pages/#comments</comments>
		<pubDate>Sat, 04 Jun 2005 14:48:06 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.dagondesign.com/?p=10</guid>
		<description><![CDATA[Custom error pages are often overlooked when designing a website simply because many people do not understand how important they can be. A standard error page gives the proper information of course, but a nice custom error page can do so much more. ]]></description>
			<content:encoded><![CDATA[<p>Custom error pages are often overlooked when designing a website simply because many people do not understand how important they can be. A standard error page gives the proper information of course, but a nice custom error page can do so much more. <span id="more-10"></span>When someone encounters a bad link to your site and sees a traditional error page they will probably just leave. If you have good custom error pages which not only look nice, but also give the user links to the sections of your site, they will almost always click through to find what they need. This article will explain how to create this small but important addition to your site.</p>
<h3>Requirements</h3>
<p>To create custom error pages using the method below you will need to have access to your .htaccess file. If you are not familiar with this file, you can find an introduction to it on this site.</p>
<p>Many web hosts give you the ability to create custom error pages from an online control panel. My host supports this, but doing it manually gives you much more control.</p>
<h3>The code</h3>
<p>The code for custom error pages is in the following format:</p>
<pre>ErrorDocument (3 digit error code) (path to error page)</pre>
<p>Here is an example. This is what I generally use myself:</p>
<pre>ErrorDocument 400 /errors/400.htm
ErrorDocument 401 /errors/401.htm
ErrorDocument 403 /errors/403.htm
ErrorDocument 404 /errors/404.htm
ErrorDocument 500 /errors/500.htm </pre>
<p>There are several other error codes, but these five are generally accepted as the most common ones that visitors will encounter. For a more complete list, with information on the specific errors, you can visit the <a href="http://www.w3.org/">World Wide Web Consortium</a>.</p>
<p>In the above code, the error documents are contained in an â€˜errorsâ€™ directory on my web server. You can place them anywhere you like, but it is very important that you always use relative paths to the files. This is the path relative to the root directory of your web server. It always starts with a forward slash!</p>
<h3>Creating the pages</h3>
<p>There is only one important rule to remember when creating your error pages &#8211; the file size. Internet Explorer (at least versions 5 and up) have problems displaying custom error pages that are less than 10 Kilobytes in size. Some people say the minimum is 512 bytes but from my own testing I find it is much better to make them at least 10 Kilobytes. That is, if you want them to always work!</p>
<p>A simple way to increase the size of your error pages is to add in random text in comment tags as shown below:</p>
<pre>&lt;!&#45;- comments comments comments etc&#46;.. &#45;-&gt;</pre>
<h3>A few notes on content</h3>
<p>Some web sites are configured to redirect the user back to the homepage when there is an error. While this certainly works, it is not very practical. If there is a true error occurring, then the user needs to know. It is also important because it can let people know that they need to update their links!</p>
<p>The goal of a good custom error page is not to hide the error message but rather to make it attractive to the viewer and easy for them to find what they are looking for. You can have a simple link to your main index, or even a full sitemap. Either way it will mean a lot more people are coming back to your site!</p>
<h3>Testing and troubleshooting</h3>
<p>After you have uploaded your modified .htaccess file and the custom error pages you can easily test them by trying to access a non-existent file on your web server. </p>
<p>For those of you who are currently using any kind of redirect or mod_rewrite code in your .htaccess file, I find that it helps to put your custom error page code before any of this. Otherwise it may have trouble displaying your pages on some servers. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagondesign.com/articles/custom-error-pages/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
