<?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>satishgaudo.com</title>
	<atom:link href="http://satishgaudo.com/satblog/feed/" rel="self" type="application/rss+xml" />
	<link>http://satishgaudo.com/satblog</link>
	<description>Understanding technology</description>
	<lastBuildDate>Mon, 14 May 2012 11:12:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>load mysql database from command prompt using source command</title>
		<link>http://satishgaudo.com/satblog/2012/05/14/load-mysql-database-from-command-prompt-using-source-command/</link>
		<comments>http://satishgaudo.com/satblog/2012/05/14/load-mysql-database-from-command-prompt-using-source-command/#comments</comments>
		<pubDate>Mon, 14 May 2012 11:12:49 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=354</guid>
		<description><![CDATA[
			
				
			
		
mysql>create database new_database;
mysql>use new_database;
mysql>source /opt/new_database_0435.sql
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2012%2F05%2F14%2Fload-mysql-database-from-command-prompt-using-source-command%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2012%2F05%2F14%2Fload-mysql-database-from-command-prompt-using-source-command%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>mysql>create database new_database;<br />
mysql>use new_database;<br />
mysql>source /opt/new_database_0435.sql</p>
]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2012/05/14/load-mysql-database-from-command-prompt-using-source-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql:Find invalid email addresses using regular expression in select query</title>
		<link>http://satishgaudo.com/satblog/2012/03/07/mysqlfind-invalid-email-addresses-using-regular-expression-in-select-query/</link>
		<comments>http://satishgaudo.com/satblog/2012/03/07/mysqlfind-invalid-email-addresses-using-regular-expression-in-select-query/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 11:35:55 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[Regular expression]]></category>
		<category><![CDATA[email validation]]></category>
		<category><![CDATA[Mysql Find invalid email addresses using regular expression in select query]]></category>
		<category><![CDATA[Regular Expressions]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=350</guid>
		<description><![CDATA[
			
				
			
		
To find invalid email addresses from a  users table containing column email storing user email address use following mysql query with regular expression

&#160;
SELECT email invalidemail FROM users 
WHERE email NOT REGEXP '^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]@[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]\.[a-zA-Z]{2,4}$'

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2012%2F03%2F07%2Fmysqlfind-invalid-email-addresses-using-regular-expression-in-select-query%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2012%2F03%2F07%2Fmysqlfind-invalid-email-addresses-using-regular-expression-in-select-query%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>To find invalid email addresses from a  users table containing column email storing user email address use following mysql query with regular expression</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;
SELECT email invalidemail FROM users 
WHERE email NOT REGEXP <span style="color: #0000ff;">'^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]@[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]\.[a-zA-Z]{2,4}$'</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2012/03/07/mysqlfind-invalid-email-addresses-using-regular-expression-in-select-query/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Php:trim a string without cutting the word</title>
		<link>http://satishgaudo.com/satblog/2011/11/19/phptrim-a-string-without-cutting-the-word/</link>
		<comments>http://satishgaudo.com/satblog/2011/11/19/phptrim-a-string-without-cutting-the-word/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 08:13:49 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Php:trim a string without cutting the word]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=348</guid>
		<description><![CDATA[
			
				
			
		

function neat_trim&#40;$str, $n, $delim='...'&#41; &#123;
	   $len = strlen&#40;$str&#41;;
	   if &#40;$len &#62; $n&#41; &#123;
	       preg_match&#40;'/(.{' . $n . '}.*?)\b/', $str, $matches&#41;;
	       return rtrim&#40;$matches&#91;1&#93;&#41; . $delim;
	   &#125;
	   else &#123;
	       return $str;
	 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F19%2Fphptrim-a-string-without-cutting-the-word%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F19%2Fphptrim-a-string-without-cutting-the-word%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> neat_trim<span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #339933;">,</span> <span style="color: #000088;">$n</span><span style="color: #339933;">,</span> <span style="color: #000088;">$delim</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'...'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	   <span style="color: #000088;">$len</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	   <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$len</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$n</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	       <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/(.{'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$n</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'}.*?)\b/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	       <span style="color: #b1b100;">return</span> <span style="color: #990000;">rtrim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$delim</span><span style="color: #339933;">;</span>
	   <span style="color: #009900;">&#125;</span>
	   <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	       <span style="color: #b1b100;">return</span> <span style="color: #000088;">$str</span><span style="color: #339933;">;</span>
	   <span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2011/11/19/phptrim-a-string-without-cutting-the-word/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Php:get valid url</title>
		<link>http://satishgaudo.com/satblog/2011/11/19/phpget-valid-url/</link>
		<comments>http://satishgaudo.com/satblog/2011/11/19/phpget-valid-url/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 08:11:56 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[valid url]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=346</guid>
		<description><![CDATA[
			
				
			
		

function formatUrl&#40;$sDispTitle&#41;&#123;
			$sDispTitle = str_replace&#40;'-','',$sDispTitle&#41;;
			$sDispTitle = str_replace&#40;' ','-',$sDispTitle&#41;;
			$sDispTitle = str_replace&#40;',','-',$sDispTitle&#41;;
			$sDispTitle = str_replace&#40;'&#38;','',$sDispTitle&#41;;
			$sDispTitle = str_replace&#40;'/','-',$sDispTitle&#41;;
			$sDispTitle = str_replace&#40;'.','',$sDispTitle&#41;;
			$sDispTitle = str_replace&#40;'?','',$sDispTitle&#41;;
			$sDispTitle = str_replace&#40;&#34;'&#34;,'',$sDispTitle&#41;;
			$sDispTitle = str_replace&#40;&#34;!&#34;,'',$sDispTitle&#41;;
			$sDispTitle = str_replace&#40;'&#34;','',$sDispTitle&#41;;
			$sDispTitle = str_replace&#40;'%','',$sDispTitle&#41;;
			$sDispTitle = str_replace&#40;'#','',$sDispTitle&#41;;
			return $sDispTitle;
	&#125;

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F19%2Fphpget-valid-url%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F19%2Fphpget-valid-url%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> formatUrl<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sDispTitle</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$sDispTitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$sDispTitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$sDispTitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span><span style="color: #000088;">$sDispTitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$sDispTitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span><span style="color: #000088;">$sDispTitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$sDispTitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&amp;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$sDispTitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$sDispTitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span><span style="color: #000088;">$sDispTitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$sDispTitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'.'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$sDispTitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$sDispTitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'?'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$sDispTitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$sDispTitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$sDispTitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$sDispTitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;!&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$sDispTitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$sDispTitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&quot;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$sDispTitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$sDispTitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$sDispTitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$sDispTitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$sDispTitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$sDispTitle</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2011/11/19/phpget-valid-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP:check if valid email using regular expression</title>
		<link>http://satishgaudo.com/satblog/2011/11/19/phpcheck-if-valid-email-using-regular-expression/</link>
		<comments>http://satishgaudo.com/satblog/2011/11/19/phpcheck-if-valid-email-using-regular-expression/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 08:08:35 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Regular expression]]></category>
		<category><![CDATA[email validation]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=344</guid>
		<description><![CDATA[
			
				
			
		

	function isValidEmail&#40;$email&#41;&#123;
		return eregi&#40;&#34;^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$&#34;, $email&#41;;
	&#125;

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F19%2Fphpcheck-if-valid-email-using-regular-expression%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F19%2Fphpcheck-if-valid-email-using-regular-expression%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">function</span> isValidEmail<span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #990000;">eregi</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2011/11/19/phpcheck-if-valid-email-using-regular-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regular expression to replace multiple white spaces with single -</title>
		<link>http://satishgaudo.com/satblog/2011/11/19/regular-expression-to-replace-multiple-white-spaces-with-single/</link>
		<comments>http://satishgaudo.com/satblog/2011/11/19/regular-expression-to-replace-multiple-white-spaces-with-single/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 07:04:58 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Regular expression]]></category>
		<category><![CDATA[Regular expression to replace multiple white spaces]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=342</guid>
		<description><![CDATA[
			
				
			
		

$sTitle=&#34;test    test123&#34;;
&#160;
$sTitle = preg_replace&#40;&#34;'\s+'&#34;, '-', $sTitle&#41;;
&#160;
print $sTitle;
&#160;
output:test-test123

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F19%2Fregular-expression-to-replace-multiple-white-spaces-with-single%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F19%2Fregular-expression-to-replace-multiple-white-spaces-with-single%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$sTitle</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;test    test123&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$sTitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;'\s+'&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sTitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">print</span> <span style="color: #000088;">$sTitle</span><span style="color: #339933;">;</span>
&nbsp;
output<span style="color: #339933;">:</span>test<span style="color: #339933;">-</span>test123</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2011/11/19/regular-expression-to-replace-multiple-white-spaces-with-single/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Uploaded media file type validation</title>
		<link>http://satishgaudo.com/satblog/2011/11/19/php-uploaded-media-file-type-validation/</link>
		<comments>http://satishgaudo.com/satblog/2011/11/19/php-uploaded-media-file-type-validation/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 06:57:20 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP: Uploaded media file type validation]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=339</guid>
		<description><![CDATA[
			
				
			
		

function typevalidation&#40;$uploadfiletype,$mediatype,$tmpfilename=&#34;&#34;&#41;
	&#123;
	if &#40;$tmpfilename&#41; 
	&#123;
	$sfiletype = shell_exec&#40;&#34;mimetype -bi $tmpfilename&#34;&#41;; 
	//echo &#34;In&#34;.$sfiletype;
	$typearr=explode&#40;&#34;/&#34;,$sfiletype&#41;;
	$filetype=$typearr&#91;0&#93;;
	$fileext=$typearr&#91;1&#93;;
	&#125;
&#160;
	if&#40;$uploadfiletype=='thumb'&#41;
	&#123;
		if&#40;$filetype!='image'&#41;
		&#123;
			$errmsg=&#34;errormessage1&#34;;
		&#125;
		else&#123;
		$errmsg=&#34;ok&#34;;
		&#125;
	&#125;
	else if&#40;$uploadfiletype=='media'&#41;
	&#123;
		if&#40;$mediatype==&#34;image&#34;&#41;
		&#123;
		if&#40;$filetype!='image'&#41;
		&#123;
			$errmsg=&#34;errormessage2&#34;;
		&#125;
		else
			&#123;$errmsg=&#34;ok&#34;;
			&#125;
		&#125;
		else if&#40;$mediatype==&#34;video&#34;&#41;
		&#123;
		if&#40;$filetype!='video'&#41;
		&#123;
			$errmsg=&#34;errormessage3&#34;;
		&#125;
		elseif&#40;strpos&#40;$fileext,&#34;flv&#34;&#41;===false&#41;
		&#123;
		$errmsg=&#34;errormessage4&#34;;	
		&#125;
		else
			&#123;$errmsg=&#34;ok&#34;;
			&#125;
		&#125;
	&#125;
	return $errmsg;
	&#125;

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F19%2Fphp-uploaded-media-file-type-validation%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F19%2Fphp-uploaded-media-file-type-validation%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> typevalidation<span style="color: #009900;">&#40;</span><span style="color: #000088;">$uploadfiletype</span><span style="color: #339933;">,</span><span style="color: #000088;">$mediatype</span><span style="color: #339933;">,</span><span style="color: #000088;">$tmpfilename</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tmpfilename</span><span style="color: #009900;">&#41;</span> 
	<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$sfiletype</span> <span style="color: #339933;">=</span> <span style="color: #990000;">shell_exec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;mimetype -bi <span style="color: #006699; font-weight: bold;">$tmpfilename</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
	<span style="color: #666666; font-style: italic;">//echo &quot;In&quot;.$sfiletype;</span>
	<span style="color: #000088;">$typearr</span><span style="color: #339933;">=</span><span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$sfiletype</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$filetype</span><span style="color: #339933;">=</span><span style="color: #000088;">$typearr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$fileext</span><span style="color: #339933;">=</span><span style="color: #000088;">$typearr</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$uploadfiletype</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'thumb'</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$filetype</span><span style="color: #339933;">!=</span><span style="color: #0000ff;">'image'</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$errmsg</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;errormessage1&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$errmsg</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;ok&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$uploadfiletype</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'media'</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$mediatype</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;image&quot;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$filetype</span><span style="color: #339933;">!=</span><span style="color: #0000ff;">'image'</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$errmsg</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;errormessage2&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span>
			<span style="color: #009900;">&#123;</span><span style="color: #000088;">$errmsg</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;ok&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$mediatype</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;video&quot;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$filetype</span><span style="color: #339933;">!=</span><span style="color: #0000ff;">'video'</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$errmsg</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;errormessage3&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fileext</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;flv&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">===</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$errmsg</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;errormessage4&quot;</span><span style="color: #339933;">;</span>	
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span>
			<span style="color: #009900;">&#123;</span><span style="color: #000088;">$errmsg</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;ok&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$errmsg</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2011/11/19/php-uploaded-media-file-type-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YouTube Trends Dashboard</title>
		<link>http://satishgaudo.com/satblog/2011/11/11/youtube-trends-dashboard/</link>
		<comments>http://satishgaudo.com/satblog/2011/11/11/youtube-trends-dashboard/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 19:39:26 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[Technology updates]]></category>
		<category><![CDATA[YouTube Trends Dashboard]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=337</guid>
		<description><![CDATA[
			
				
			
		
Want to know wants trending now on youtube just check
YouTube Trends Dashboard
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F11%2Fyoutube-trends-dashboard%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F11%2Fyoutube-trends-dashboard%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Want to know wants trending now on youtube just check<br />
<a href='http://www.youtube.com/trendsdashboard'  target="_blank"><strong>YouTube Trends Dashboard</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2011/11/11/youtube-trends-dashboard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Real-Time Insights Finder &#124; Think Insights with Google</title>
		<link>http://satishgaudo.com/satblog/2011/11/11/real-time-insights-finder-think-insights-with-google/</link>
		<comments>http://satishgaudo.com/satblog/2011/11/11/real-time-insights-finder-think-insights-with-google/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 19:34:12 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[Technology updates]]></category>
		<category><![CDATA[Real-Time Insights Finder]]></category>
		<category><![CDATA[Think Insights with Google]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=333</guid>
		<description><![CDATA[
			
				
			
		
A Google developed tool that hubs up all the great complimentary Google tools to understand the key target consumer, where and how they spend time. Essential for media planning!
Google Insights
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F11%2Freal-time-insights-finder-think-insights-with-google%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F11%2Freal-time-insights-finder-think-insights-with-google%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>A Google developed tool that hubs up all the great complimentary Google tools to understand the key target consumer, where and how they spend time. Essential for media planning!</p>
<p><a href='http://www.thinkwithgoogle.com/insights/tools/real-time-insights/' target="_blank"><strong>Google Insights</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2011/11/11/real-time-insights-finder-think-insights-with-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Maps JavaScript API v3 Example</title>
		<link>http://satishgaudo.com/satblog/2011/11/02/google-maps-javascript-api-v3-example/</link>
		<comments>http://satishgaudo.com/satblog/2011/11/02/google-maps-javascript-api-v3-example/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 11:09:26 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[Technology updates]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Google Maps JavaScript API v3]]></category>
		<category><![CDATA[Google Maps JavaScript API v3 Example]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=331</guid>
		<description><![CDATA[
			
				
			
		

&#160;
&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62;
&#60;head runat=&#34;server&#34;&#62;
    &#60;meta name=&#34;viewport&#34; content=&#34;initial-scale=1.0, user-scalable=no&#34; /&#62;
    &#60;meta http-equiv=&#34;content-type&#34; content=&#34;text/html; charset=UTF-8&#34; /&#62;
    &#60;style type=&#34;text/css&#34;&#62;
        html
        &#123;
         [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F02%2Fgoogle-maps-javascript-api-v3-example%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2011%2F11%2F02%2Fgoogle-maps-javascript-api-v3-example%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #339933;">&lt;!</span>DOCTYPE html <span style="color: #000000; font-weight: bold;">PUBLIC</span> <span style="color: #0000ff;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #0000ff;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>html xmlns<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>head runat<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;server&quot;</span><span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>meta name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;viewport&quot;</span> content<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;initial-scale=1.0, user-scalable=no&quot;</span> <span style="color: #339933;">/&gt;</span>
    <span style="color: #339933;">&lt;</span>meta http<span style="color: #339933;">-</span>equiv<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;content-type&quot;</span> content<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/html; charset=UTF-8&quot;</span> <span style="color: #339933;">/&gt;</span>
    <span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/css&quot;</span><span style="color: #339933;">&gt;</span>
        html
        <span style="color: #009900;">&#123;</span>
            height<span style="color: #339933;">:</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">%;</span>
        <span style="color: #009900;">&#125;</span>
        body
        <span style="color: #009900;">&#123;</span>
            height<span style="color: #339933;">:</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">%;</span>
            margin<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span> auto<span style="color: #339933;">;</span>
            padding<span style="color: #339933;">:</span> 0px 250px<span style="color: #339933;">;</span>
            text<span style="color: #339933;">-</span>align<span style="color: #339933;">:</span>center<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>Google Maps JavaScript API v3 Example<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
&nbsp;
    <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://maps.google.com/maps/api/js?sensor=false&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
    <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">var</span> geocoder<span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">var</span> map<span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">var</span> markersArray <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">var</span> marker<span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">var</span> infowindow <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> google<span style="color: #339933;">.</span>maps<span style="color: #339933;">.</span>InfoWindow<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">var</span> address <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;153, Second Floor, Raghuleela Mall, Opposite Vashi Railway Station, Vashi Plaza, Vashi, Navi Mumbai,India&quot;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> initializeMap<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            geocoder <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> google<span style="color: #339933;">.</span>maps<span style="color: #339933;">.</span>Geocoder<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">var</span> myOptions <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
            zoom<span style="color: #339933;">:</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span>
                mapTypeId<span style="color: #339933;">:</span> google<span style="color: #339933;">.</span>maps<span style="color: #339933;">.</span>MapTypeId<span style="color: #339933;">.</span>ROADMAP
            <span style="color: #009900;">&#125;</span>
            map <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> google<span style="color: #339933;">.</span>maps<span style="color: #339933;">.</span>Map<span style="color: #009900;">&#40;</span>document<span style="color: #339933;">.</span>getElementById<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;map_canvas&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> myOptions<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            codeAddressMap<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            google<span style="color: #339933;">.</span>maps<span style="color: #339933;">.</span>event<span style="color: #339933;">.</span>addListener<span style="color: #009900;">&#40;</span>map<span style="color: #339933;">,</span> <span style="color: #0000ff;">'click'</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                placeMarker<span style="color: #009900;">&#40;</span>event<span style="color: #339933;">.</span>latLng<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> codeAddressMap<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            geocoder<span style="color: #339933;">.</span>geocode<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">'address'</span><span style="color: #339933;">:</span> address <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>results<span style="color: #339933;">,</span> status<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>status <span style="color: #339933;">==</span> google<span style="color: #339933;">.</span>maps<span style="color: #339933;">.</span>GeocoderStatus<span style="color: #339933;">.</span>OK<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    clearOverlaysMap<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    map<span style="color: #339933;">.</span>setCenter<span style="color: #009900;">&#40;</span>results<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>geometry<span style="color: #339933;">.</span>location<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    marker <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> google<span style="color: #339933;">.</span>maps<span style="color: #339933;">.</span>Marker<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                        map<span style="color: #339933;">:</span> map<span style="color: #339933;">,</span>
                        title<span style="color: #339933;">:</span> results<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'formatted_address'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
                        position<span style="color: #339933;">:</span> results<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>geometry<span style="color: #339933;">.</span>location<span style="color: #339933;">,</span>
                        animation<span style="color: #339933;">:</span> google<span style="color: #339933;">.</span>maps<span style="color: #339933;">.</span>Animation<span style="color: #339933;">.</span>DROP
                    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>results<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span>undefined<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						infowindow<span style="color: #339933;">.</span>setContent<span style="color: #009900;">&#40;</span>results<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>formatted_address<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						infowindow<span style="color: #339933;">.</span>open<span style="color: #009900;">&#40;</span>map<span style="color: #339933;">,</span> marker<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						markersArray<span style="color: #339933;">.</span>push<span style="color: #009900;">&#40;</span>marker<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>	
&nbsp;
                <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                    alert<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Geocode was not successful for the following reason: &quot;</span> <span style="color: #339933;">+</span> status<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> placeMarker<span style="color: #009900;">&#40;</span>location<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            geocoder<span style="color: #339933;">.</span>geocode<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">'latLng'</span><span style="color: #339933;">:</span> location <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>results<span style="color: #339933;">,</span> status<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>status <span style="color: #339933;">==</span> google<span style="color: #339933;">.</span>maps<span style="color: #339933;">.</span>GeocoderStatus<span style="color: #339933;">.</span>OK<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>results<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        clearOverlaysMap<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>					
                        marker <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> google<span style="color: #339933;">.</span>maps<span style="color: #339933;">.</span>Marker<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                            position<span style="color: #339933;">:</span> location<span style="color: #339933;">,</span>
                            title<span style="color: #339933;">:</span> results<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>formatted_address<span style="color: #339933;">,</span>
                            map<span style="color: #339933;">:</span> map<span style="color: #339933;">,</span>
                            animation<span style="color: #339933;">:</span> google<span style="color: #339933;">.</span>maps<span style="color: #339933;">.</span>Animation<span style="color: #339933;">.</span>DROP
                        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        infowindow<span style="color: #339933;">.</span>setContent<span style="color: #009900;">&#40;</span>results<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>formatted_address<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        infowindow<span style="color: #339933;">.</span>open<span style="color: #009900;">&#40;</span>map<span style="color: #339933;">,</span> marker<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                        markersArray<span style="color: #339933;">.</span>push<span style="color: #009900;">&#40;</span>marker<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                        google<span style="color: #339933;">.</span>maps<span style="color: #339933;">.</span>event<span style="color: #339933;">.</span>addListener<span style="color: #009900;">&#40;</span>marker<span style="color: #339933;">,</span> <span style="color: #0000ff;">'click'</span><span style="color: #339933;">,</span> toggleBounceMap<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                        map<span style="color: #339933;">.</span>setCenter<span style="color: #009900;">&#40;</span>location<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                    alert<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Geocoder failed due to: &quot;</span> <span style="color: #339933;">+</span> status<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">function</span> clearOverlaysMap<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>markersArray<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i in markersArray<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    markersArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>setMap<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">function</span> toggleBounceMap<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>marker<span style="color: #339933;">.</span>getAnimation<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                marker<span style="color: #339933;">.</span>setAnimation<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                marker<span style="color: #339933;">.</span>setAnimation<span style="color: #009900;">&#40;</span>google<span style="color: #339933;">.</span>maps<span style="color: #339933;">.</span>Animation<span style="color: #339933;">.</span>BOUNCE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body onload<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;initializeMap()&quot;</span> <span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;</span>table width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;800px&quot;</span> cellpadding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span> cellspacing<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span> border<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;</span>
            <span style="color: #339933;">&lt;</span>td colspan<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;2&quot;</span> align<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;center&quot;</span><span style="color: #339933;">&gt;</span>
                <span style="color: #339933;">&lt;</span>h2<span style="color: #339933;">&gt;</span>Map My Address<span style="color: #339933;">&lt;/</span>h2<span style="color: #339933;">&gt;</span>
&nbsp;
            <span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;/</span>tr<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;</span>
            <span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;</span>
                <span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;map_canvas&quot;</span> style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;height:300px; width:300px;&quot;</span> <span style="color: #339933;">&gt;</span>
&nbsp;
                <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
            <span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;/</span>tr<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;/</span>table<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2011/11/02/google-maps-javascript-api-v3-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

