<?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>Cache Up - How To&#039;s and Tutorials</title>
	<atom:link href="http://cacheup.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://cacheup.com</link>
	<description>Windows, Mac OS X, Apple, iPhone, iPad, and More.</description>
	<lastBuildDate>Sat, 14 Jan 2012 20:55:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How to Create a Basic Login Script in PHP</title>
		<link>http://cacheup.com/2012/01/01/php-login-script/</link>
		<comments>http://cacheup.com/2012/01/01/php-login-script/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 18:14:23 +0000</pubDate>
		<dc:creator>Brandon Smith</dc:creator>
				<category><![CDATA[How To's]]></category>
		<category><![CDATA[Login Script]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://cacheup.com/?p=4731</guid>
		<description><![CDATA[I remember a time when I used to have a hard time finding a simple, yet effective PHP Login Script (not too long ago!). Sure, I found many scripts with the help of Google, but many of them had errors &#8230; <a href="http://cacheup.com/2012/01/01/php-login-script/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I remember a time when I used to have a hard time finding a simple, yet effective PHP Login Script (not too long ago!). Sure, I found many scripts with the help of Google, but many of them had errors or weren&#8217;t shielded against SQL Injections. Today, I am going to guide you through the steps of creating your own login script &#8212; explaining how things work while also providing a basic login script.</p>
<p><strong>Requirements</strong></p>
<ul>
<li>PHP version 4.3 or later (I am using PHP 5.3)</li>
<li>mySQL version 4.1.2 or later (I am using mySQL 5.x)</li>
<li>A robust web server to execute the script from a browser.</li>
</ul>
<p><strong>Tutorial</strong></p>
<ol>
<li><em>Create the Database</em>: You will need to create a database and table for the login script to function. In this tutorial, we will assume the database name to be &#8220;login_test&#8221; and the table name to be &#8220;users.&#8221; The users table will contain a list of usernames and passwords allowed to connect via the login script. The table should have a unique ID as the primary field, as well a username and password field.</li>
<li><em>Create the Login Page</em>: It&#8217;ll be an HTML file containing a form with two input fields (username, password) and a submit button.</li>
<li><em>Create the PHP Script</em>: You will now need to write the code to be computed and executed by PHP. Of course, I&#8217;ve already done this for you, but I am going to explain each piece of code to help you get a grip on what the script does.</li>
</ol>
<div><strong>Description</strong></div>
<div></div>
<div>
<ul>
<li><em>Lines 1 &#8211; 5</em>: Define DB_HOST, DB_USER, DB_PASS, and DB_NAME to connect to mySQL Server.</li>
<li>Line 7: Login Function to verify login credentials.</li>
<li>Lines 9 &#8211; 20: If the $username or $password field are empty, the function will return false, outputting a login error.</li>
<li>Lines 21 &#8211; 22: Escapes special characters in a string for use in an SQL statement to prevent SQL Injections.</li>
<li>Lines 23 &#8211; 24: Create an MD5 Hash of the $password variable and remove any non-alphanumeric characters from the $username.</li>
<li>Lines 26 &#8211; 27: Connect to mySQL Server and select database.</li>
<li>Lines 29 &#8211; 31: Query a match for $username and $password combination.</li>
<li>Lines 32 &#8211; 40: If $result = 1, store $_SESSION[]; else, the function will return false and output a login error for &#8220;Invalid Username or Password!&#8221;</li>
<li>Lines 49 &#8211; 61: If $_GET['do'] = login or login.php?do=login, then the login function will be executed with values submitted to the login form. It&#8217;ll also output login errors and/or redirect you to the login form.</li>
</ul>
</div>
<p><strong>Login.php</strong></p>
<pre>&lt;?php
define("DB_HOST", "localhost"); //database host (usually localhost)
define("DB_USER", "username"); //database user to connect to mysql
define("DB_PASS", "password"); //database pass to connect to user
define("DB_NAME", "login_script"); //name of database to be used

function login($username,$password) {
	global $error;
	if (empty($username) || empty($password)) {
		if (empty($username) &amp;&amp; empty($password)) {
			$error['login'] = "Username and Password cannot be left blank!";
			return false;
		} elseif (empty($username)) {
			$error['login'] = "Username cannot be left blank!";
			return false;
		} else {
			$error['login'] = "Password cannot be left blank!";
			return false;
		}
	}
	$username = mysql_real_escape_string($username); //prevents sql injection
	$password = mysql_real_escape_string($password); //prevents sql injection
	$password = md5($password); //encrypt password using md5 hash
	$username2 = preg_replace("/[^a-zA-Z0-9]/", "", $username); //replace non alphanumeric characters
	if ($username2 == $username) {
		$mysql = mysql_connect(DB_HOST,DB_USER,DB_PASS); //connect to mysql
		mysql_select_db(DB_NAME, $mysql); //select the database
		if ($mysql) {
			$query = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'");
			$result = mysql_num_rows($query);
			mysql_close($mysql);
			if ($result == 1) {
				session_start();
				$_SESSION['loginsys'] = $username . ":" . rand(1,1000);
				$_SESSION['loginsys_user'] = $username;
				$_SESSION['loginsys_pass'] = $password;
				return true;
			} else {
				$error['login'] = "Invalid Username or Password!";
			}
		} else {
			$error['login'] = "Trouble Connecting to mySQL Server.";
		}
	} else {
		$error['login'] = "Alphanumeric Characters Allowed Only! [Username]";
	}
	return false;
}
if (isset($_GET['do'])) {
	if ($_GET['do'] == "login") {
		if (login($_POST['username'],$_POST['password']) &amp;&amp; empty($error['login'])) {
			header("Location: index.php");
		} else {
			echo $error['login'];
		}
	} else {
		header("Location: login.php");
	}
} else {
	include("login.html"); //load html login page
} ?&gt;</pre>
<p><strong>Login.html</strong></p>
<pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
&lt;head profile="http://gmpg.org/xfn/11"&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
&lt;title&gt;Login Form&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form name="login" action="login.php?do=login" method="POST"&gt;
&lt;input type="text" name="username" value="" /&gt;
&lt;input type="password" name="password" value="" /&gt;
&lt;input type="submit" name="Login" value="Login" /&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong>Index.php</strong></p>
<pre>&lt;?php
session_start();

if (isset($_SESSION['loginsys'])) {
	echo "Success. LoginSys Session = " . $_SESSION['loginsys'];
} else {
	header("Location: login.php");
}

?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://cacheup.com/2012/01/01/php-login-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Fix ERROR 2002 (HY000): Can&#8217;t Connect to Local MySQL Server</title>
		<link>http://cacheup.com/2011/12/31/error-2002-mysql-server/</link>
		<comments>http://cacheup.com/2011/12/31/error-2002-mysql-server/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 04:34:12 +0000</pubDate>
		<dc:creator>Brandon Smith</dc:creator>
				<category><![CDATA[How To's]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mySQL]]></category>

		<guid isPermaLink="false">http://cacheup.com/?p=4714</guid>
		<description><![CDATA[On Wednesday, I experienced trouble with my VPS hosted at Linode &#8212; the problem first began with my websites being unresponsive, though Nginx was still accepting requests. I initiated a reboot and soon after, my websites became responsive. However, I received a &#8230; <a href="http://cacheup.com/2011/12/31/error-2002-mysql-server/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>On Wednesday, I experienced trouble with my VPS hosted at Linode &#8212; the problem first began with my websites being unresponsive, though Nginx was still accepting requests. I initiated a reboot and soon after, my websites became responsive. However, I received a db connection error and discovered that I was unable to start the mySQL Server:</p>
<blockquote><p>ERROR 2002 (HY000): Can&#8217;t connect to local MySQL server through socket &#8216;/var/run/mysqld/mysqld.sock&#8217; (2)</p></blockquote>
<p>I quickly began to troubleshoot the source of the error and after reading a dozen or so forums, I found a simple &#8220;fix&#8221; that could&#8217;ve been prevented from the beginning. The problem? I had used up all available disk space on my VPS Node, causing mySQL and other vital programs to be corrupt. I quickly deleted some files (I downloaded the 3.6GB Windows 8 Dev. Preview to my VPS the day before) and after typing &#8220;mysql service start&#8221; in the terminal, the mySQL Server was once again responding and serving requests to the few websites I own.</p>
<p>While the aforementioned error can be caused by several other problems with your server&#8217;s configuration and mySQL installation, I&#8217;d execute &#8220;df -h&#8221; before going through any additional trouble. If the disk space does not seem to be the root of the error above, carry on with your web search to find the culprit behind the flaw.</p>
]]></content:encoded>
			<wfw:commentRss>http://cacheup.com/2011/12/31/error-2002-mysql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Create a Bootable Windows 8 DVD</title>
		<link>http://cacheup.com/2011/12/31/create-bootable-windows-8-dvd/</link>
		<comments>http://cacheup.com/2011/12/31/create-bootable-windows-8-dvd/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 17:38:53 +0000</pubDate>
		<dc:creator>Brandon Smith</dc:creator>
				<category><![CDATA[How To's]]></category>
		<category><![CDATA[DVD]]></category>
		<category><![CDATA[ISO]]></category>
		<category><![CDATA[Windows 8]]></category>

		<guid isPermaLink="false">http://cacheup.com/?p=4690</guid>
		<description><![CDATA[I experimented and tested the Windows 8 Developer Preview last week and am quite impressed with Microsoft&#8217;s upcoming operating system. Windows 8 features a slightly modified UI, with noticeable changes in the Start Menu, Task Manager, and Control Panel. Here&#8217;s &#8230; <a href="http://cacheup.com/2011/12/31/create-bootable-windows-8-dvd/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-large wp-image-4700" title="win8 start menu" src="http://cacheup.com/wp-content/uploads/2011/12/win8-start-menu-610x343.png" alt="" width="584" height="328" /></p>
<p>I experimented and tested the Windows 8 Developer Preview last week and am quite impressed with Microsoft&#8217;s upcoming operating system. Windows 8 features a slightly modified UI, with noticeable changes in the Start Menu, Task Manager, and Control Panel. Here&#8217;s how to create a bootable Windows 8 DVD.</p>
<p><strong>Requirements</strong></p>
<ul>
<li>1 gigahertz (GHz) or faster 32-bit (x86) or 64-bit (x64) processor</li>
<li>1 gigabyte (GB) RAM (32-bit) or 2 GB RAM (64-bit)</li>
<li>16 GB available hard disk space (32-bit) or 20 GB (64-bit)</li>
<li>DirectX 9 graphics device with WDDM 1.0 or higher driver</li>
<li>Taking advantage of touch input requires a screen that supports multi-touch</li>
<li>To run Metro style Apps, you need a screen resolution of 1024 X 768 or greater</li>
<li>Windows 8 Dev. Preview 32 or 64-bit [<a href="http://msdn.microsoft.com/en-us/windows/apps/br229516">Download</a>]</li>
<li>Windows 7 USB/DVD Download Tool [<a href="http://www.microsoftstore.com/store/msstore/html/pbPage.Help_Win7_usbdvd_dwnTool">Download</a>]</li>
</ul>
<p><strong>Tutorial</strong></p>
<ol>
<li>Download and install the Windows 7 USB/DVD Download Tool and then download the Windows 8 Developer Preview.</li>
<li>Insert a blank CD/DVD having a storage capacity of 8GB or more into your computer&#8217;s CD-ROM.</li>
<li>Launch the Windows 7 USB/DVD Download Tool you configured in step one and follow the program&#8217;s steps.</li>
<li>Step 1 of 4: Choose the ISO Source File by selecting browse. (It should be stored where you opted to save the file or in the downloads folder.)</li>
<li>Step 2 of 4: Choose Media Type &#8212; USB or <em>DVD</em>. In this tutorial, we are creating a bootable DVD, so please select DVD.</li>
<li>Final Steps: Insert your DVD (we have already done that) and the bootable Windows 8 Dev. Preview DVD will be created. You can then load Windows 8 on a computer around the house and give the modern Windows a try.</li>
</ol>
<p><strong>Tips and Notes</strong></p>
<ul>
<li>It may take several hours to download Windows 8, as the size of the file ranges from 2.8GB (32-bit) to 3.6GB (64-bit).</li>
<li>I created the bootable Windows 8 DVD using Windows 7, but I imagine Windows Vista will also work.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://cacheup.com/2011/12/31/create-bootable-windows-8-dvd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Meet Iris: A Siri Clone for Android Devices</title>
		<link>http://cacheup.com/2011/11/01/iris-for-android/</link>
		<comments>http://cacheup.com/2011/11/01/iris-for-android/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 20:35:06 +0000</pubDate>
		<dc:creator>Brandon Smith</dc:creator>
				<category><![CDATA[Archive]]></category>

		<guid isPermaLink="false">http://cacheup.com/?p=4462</guid>
		<description><![CDATA[Wow, that didn&#8217;t take long. Narayan Babu from Dexetra spent a mere eight hours working on a Siri clone for Android Phones, named Iris. It answers many basic commands just like Siri does &#8211; you can ask it both serious and comedic-like things, &#8230; <a href="http://cacheup.com/2011/11/01/iris-for-android/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Wow, that didn&#8217;t take long. Narayan Babu from <em>Dexetra</em> spent a mere eight hours working on a Siri clone for <a href="http://www.o2.co.uk/androidphones">Android Phones</a>, named Iris. It answers many basic commands just like Siri does &#8211; you can ask it both serious and comedic-like things, and it&#8217;ll give you a response. Iris also displays images when it can (and makes them clickable). Based on the supplied screenshots and feedback it has received on the Android Market, Iris for Android seems to work quite well, given that the app is in its early stages.</p>
<p>Iris for Android even features several witty replies similar to the funny responses of Siri. Iris is still in its alpha version, but a more stable version is in the works. It&#8217;s free and can be downloaded from the Android Market.</p>
]]></content:encoded>
			<wfw:commentRss>http://cacheup.com/2011/11/01/iris-for-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

