<?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>My Blog</title>
	<atom:link href="http://rewiv.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://rewiv.com/blog</link>
	<description>My Personal Blog</description>
	<lastBuildDate>Sat, 12 Dec 2009 23:20:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title></title>
		<link>http://rewiv.com/blog/2009/12/12/finding-extensions-in-php-without-using-mime-info/</link>
		<comments>http://rewiv.com/blog/2009/12/12/finding-extensions-in-php-without-using-mime-info/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 23:19:56 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[file handling]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[upload]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://rewiv.com/blog/?p=26</guid>
		<description><![CDATA[For all you geeks, finding an extension, cross platform, because application/type doesn&#8217;t always work with $_FILES['file']['type'] cross platform.
The mime information is read differently, I ran into this problem on unix when somebody uploaded a pdf edited on a windows machine.
function findExt($f) {
$var = $f;
$explode = explode(&#8216;.&#8217;, $var);
$num = count($explode);
$ext = strtolower($explode[$num - 1]);

return $ext;
}
Then call [...]]]></description>
			<content:encoded><![CDATA[<p>For all you geeks, finding an extension, cross platform, because application/type doesn&#8217;t always work with <span><span style="margin-left: 0px ! important;"><code>$_FILES</code><code>[</code><code>'file'</code><code>][</code><code>'type'</code><code>] </code></span></span>cross platform.</p>
<p>The mime information is read differently, I ran into this problem on unix when somebody uploaded a pdf edited on a windows machine.</p>
<p>function findExt($f) {</p>
<p style="padding-left: 30px;">$var = $f;<br />
$explode = explode(&#8216;.&#8217;, $var);<br />
$num = count($explode);<br />
$ext = strtolower($explode[$num - 1]);
</p>
<p style="padding-left: 30px;">return $ext;</p>
<p>}</p>
<p style="padding-left: 30px;">Then call it as;</p>
<p>if(in_array(findExt($file), $acceptedArray)) {<br />
<span style="padding-left: 60px;">// Do Something</span><br />
} else {<br />
<span style="padding-left: 60px;">// Do something else</span><br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://rewiv.com/blog/2009/12/12/finding-extensions-in-php-without-using-mime-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More coming soon</title>
		<link>http://rewiv.com/blog/2009/11/20/more-coming-soon/</link>
		<comments>http://rewiv.com/blog/2009/11/20/more-coming-soon/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 18:49:00 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://rewiv.com/blog/?p=23</guid>
		<description><![CDATA[I&#8217;m going to try to actually update this blog on a regular basis from now on.
I know, there are a million posts like this on blogs around the world.
Soon.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m going to try to actually update this blog on a regular basis from now on.</p>
<p>I know, there are a million posts like this on blogs around the world.</p>
<p>Soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://rewiv.com/blog/2009/11/20/more-coming-soon/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Restricting an input field to only numbers with preg_match_all() (PHP)</title>
		<link>http://rewiv.com/blog/2009/05/07/restricting-an-input-field-to-only-numbers-with-preg_match_all-php/</link>
		<comments>http://rewiv.com/blog/2009/05/07/restricting-an-input-field-to-only-numbers-with-preg_match_all-php/#comments</comments>
		<pubDate>Thu, 07 May 2009 21:12:09 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[validate]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://rewiv.com/blog/?p=15</guid>
		<description><![CDATA[This is a pretty easy way to restrict a field to only numbers.
The \D in the preg match is short for [^0-9], which will match all characters, except 0-9.
I'm new to the regex, so there might be a better way to do this.  But this works for me.

I like to do all the validating [...]]]></description>
			<content:encoded><![CDATA[<pre>This is a pretty easy way to restrict a field to only numbers.
The \D in the preg match is short for [^0-9], which will match all characters, except 0-9.
I'm new to the regex, so there might be a better way to do this.  But this works for me.

I like to do all the validating on the server side, just in case someone has javascript disabled.</pre>
<pre>&lt;?php
	if(isset($_POST['submit'])) {

		preg_match_all("/\D/i", $_POST['number'], $matches);

		if(!$matches[0][0]) {

			print("Your right " . $_POST['number'] . " is a number!");
				exit;

		}
		else {

			print("That is not a number!");
			exit;
		}

	}

?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;

&lt;head&gt;
	&lt;title&gt;Preg Match All&lt;/title&gt;
	&lt;meta http-equiv="content-type" content="text/html;charset=utf-8" /&gt;
	&lt;meta name="generator" content="Geany 0.18svn" /&gt;
&lt;/head&gt;

&lt;body&gt;
	&lt;form id="preg_match_all" name="preg_match_all" method="post" action="&lt;?php $_SERVER['PHP_SELF']; ?&gt;"&gt;
		Enter a Number : &lt;input type="text" name="number" /&gt;
		&lt;input type="submit" value="submit" name="submit" /&gt;
	&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://rewiv.com/blog/2009/05/07/restricting-an-input-field-to-only-numbers-with-preg_match_all-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install your Linksys WMP110 wireless card on linux</title>
		<link>http://rewiv.com/blog/2008/09/08/how-to-install-your-linksys-wmp110-wireless-gn-card-on-linux/</link>
		<comments>http://rewiv.com/blog/2008/09/08/how-to-install-your-linksys-wmp110-wireless-gn-card-on-linux/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 23:20:04 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[drivers]]></category>
		<category><![CDATA[ndiswrapper]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.rewiv.com/blog/?p=1</guid>
		<description><![CDATA[I run Ubuntu, but I imaging it would probably be the same for most distributions.
Install ndiswrapper, use your repos package search.  On Ubuntu it is already installed.

yum search ndiswrapper

or

aptitude search ndiswrapper.

If you need to build from source, check out this post.
Download the driver files here.  You can also snag them from the cd [...]]]></description>
			<content:encoded><![CDATA[<p>I run Ubuntu, but I imaging it would probably be the same for most distributions.<br />
Install ndiswrapper, use your repos package search.  On Ubuntu it is already installed.</p>
<p><code><br />
yum search ndiswrapper<br />
</code><br />
or<br />
<code><br />
aptitude search ndiswrapper.<br />
</code></p>
<p>If you need to build from source, check out this <a title="How-To: Compile ndiswrapper" href="http://ubuntuforums.org/showthread.php?t=104539&amp;highlight=compile+ndiswrapper+source" target="_blank">post</a>.</p>
<p>Download the driver files <a href="http://rewiv.com/blog/wp-content/uploads/2008/11/ar5416.tar.bz2">here</a>.  You can also snag them from the cd that comes with your Linksys card.</p>
<p><code><br />
tar -jxvf ar5416.tar.bz2<br />
cd ar5416<br />
ndiswrapper -i net5416.inf<br />
</code></p>
<p>Not sure if you have to use all three of these, but I do just cause it makes me feel better.</p>
<p><code><br />
ndiswrapper -m<br />
ndiswrapper -mi<br />
ndiswrapper -ma<br />
</code></p>
<p>then</p>
<p><code><br />
sudo modprobe -r ndiswrapper<br />
sudo modprobe ndiswrapper<br />
</code></p>
<p>This is what worked for me.</p>
<p>Hope it works for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://rewiv.com/blog/2008/09/08/how-to-install-your-linksys-wmp110-wireless-gn-card-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
