<?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>IT Geek! &#187; PHP</title>
	<atom:link href="http://itgeek.in/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://itgeek.in</link>
	<description>the geek life of a Web Developer and Hobbiest Photographer</description>
	<lastBuildDate>Fri, 13 Aug 2010 15:41:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adapting Microsoft .NET Framework Technology</title>
		<link>http://itgeek.in/life/adapting-microsoft-net-framework-technology.html</link>
		<comments>http://itgeek.in/life/adapting-microsoft-net-framework-technology.html#comments</comments>
		<pubDate>Thu, 03 Jun 2010 18:30:33 +0000</pubDate>
		<dc:creator>Charandeep Singh</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[college]]></category>
		<category><![CDATA[geeksingh]]></category>
		<category><![CDATA[grades]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[switch]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://itgeek.in/?p=509</guid>
		<description><![CDATA[It is now quite long, I have updated blog. Actually, it was hard time for me. There were whole lot of bad and some good things happened during this time. Things like not getting good grades and even more worse that again got compartment in one of the subject, really making me fell down. At [...]]]></description>
			<content:encoded><![CDATA[<p>It is now quite long, I have updated blog. Actually, it was hard time for me. There were whole lot of bad and some good things happened during this time. Things like not getting good grades and even more worse that again got compartment in one of the subject, really making me fell down. At one point of time, I even thought of stop doing all these computer stuff. But luckily, I can&#8217;t. <img src='http://itgeek.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Later on, me and <a href="http://webgarb.com/" target="_blank">a friend</a>, was discussing about doing something together and so decided to start a Technology Blog. We started off with very excitement. But later on, we don&#8217;t write much on it. By the way, blog is <a href="http://geeksingh.com/" target="_blank">GeekSingh.com</a>.</p>
<p>When I was new in Web Technology, it seems like PHP is only giant available to develop Dynamic Web Applications. I really work hard on learning and practicing it. It was really fun. But when I try to build larger Applications. I got stucked every-time. There was so many ideas, which I was unable to implement fully, I always got stuck in between the Projects. The reason is, PHP is a scripting language, which is not targeted for developing a specific kind of Web Applications.<span id="more-509"></span> In scripting languages, you have to write each and every logic for your application on your own, like business logic, data logic, presentation logic etc. So, it was hard for the beginner like me to write all these logics, and keep the safe balanced bridge between them. At that time, I was not aware of Frameworks used in PHP like Zend, cakePHP etc. Later on, I started exploring Wordpress. I must say, wordpress is most greatest Opensource application, I have ever seen. Whenever I mess with it, I was like &#8220;Hey man, I can do anything with this!&#8221;. <img src='http://itgeek.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  And I still love it!.</p>
<p>So, it was last year of my graduation. I was supposed to do a Project. Though it was a formality kind of thing. But still I want it to be Good, and I want to put all my dedication into it. Lecturers at college suggest us to use only Visual Basic or ASP.NET for our Projects. Those were the only two choices available. When I asked them, why can&#8217;t we use other platform/languages like PHP or anything else? they told Teachers which are going to take your test on Projects are not qualified enough. So, with this confusion and in hurry, I forcibly decided to go with ASP.NET. At that time, I didn&#8217;t know anything about ASP.NET or .NET except that it is rival of PHP. So I started presuming that ASP.NET would be similar like PHP.  We were a team of three. Now we need someone who will guide us in the project. We got this awesome <a href="http://tclogics.com/" target="_blank">teacher</a>, whom through out guide us very well. I learn alot from them. While my learning, I started feeling like it is totally different from PHP. The main thing is it is all based on Framework, which have everything we need to create a complete Web Application. And the development is so quick. I started feeling that now I can implement my previous ideas/thoughts into real-time Applications, that I was not able to do in PHP. So, I hope that switching to ASP.NET from PHP, will be one of my good decisions.</p>
]]></content:encoded>
			<wfw:commentRss>http://itgeek.in/life/adapting-microsoft-net-framework-technology.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reading Excel Spreadsheets with PHP</title>
		<link>http://itgeek.in/php/reading-excel-spreadsheets-with-php.html</link>
		<comments>http://itgeek.in/php/reading-excel-spreadsheets-with-php.html#comments</comments>
		<pubDate>Mon, 22 Jun 2009 17:43:41 +0000</pubDate>
		<dc:creator>Charandeep Singh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[office]]></category>
		<category><![CDATA[phpexcelreader]]></category>
		<category><![CDATA[spreadsheet]]></category>

		<guid isPermaLink="false">http://itgeek.in/?p=249</guid>
		<description><![CDATA[PHP is yet most powerful language when it comes to deal with different data formats like SQL Results, XML Files etc. To improve the functionality of PHP, we use extensions. There are many extensions/packages which let us to read more different types of data formats. Today, we will be using one of them, i.e. phpexcelreader.
PHPExcelReader [...]]]></description>
			<content:encoded><![CDATA[<p>PHP is yet most powerful language when it comes to deal with different data formats like SQL Results, XML Files etc. To improve the functionality of PHP, we use extensions. There are many extensions/packages which let us to read more different types of data formats. Today, we will be using one of them, i.e. <a href="http://sourceforge.net/projects/phpexcelreader/" target="_blank">phpexcelreader</a>.</p>
<p>PHPExcelReader comes with two files <em>oleread.inc</em> and <em>reader.php</em>. We will need to include <em>reader.php</em> in order to use the package. For the sake of &#8220;simplicity&#8221;, I have made some changes in example file and data. Grab it here:<span id="more-249"></span></p>
<p align="center"><a href="http://itgeek.in/wp-content/uploads/2009/06/phpexcelreader.zip">Dowload PHPExcelReader.zip</a></p>
<p align="center">Sample Excel Spreadsheet<br/>

			    <a href="http://itgeek.in/wp-content/uploads/2009/06/excel1.jpg" class="highslide"  onclick="return hs.expand(this, {captionId: 'caption-for-P2490'})"> 
                <img src="http://itgeek.in/wp-content/uploads/2009/06/excel1-300x218.jpg" alt="Sample Excel Spreadsheet" border="0" id="P2490" title="Sample Excel Spreadsheet" /></a> 
								<div class='highslide-caption' id='caption-for-P2490'>
			       		
	     				    	<a href="#" onclick="hs.close(this)" class="highslide-close">Close</a>   	
				<div style="clear:both">Sample Excel Spreadsheet</div>
	
			    </div>

</p>
<p>Take a look at <em>example.php</em>, code is pretty much straight forward. As I said before, in order to use the package we need to include <em>reader.php</em> into our code.<br />
<code>require_once('excel/reader.php');</code><br />
Next, create a new object from the class <em>Spreadsheet_Excel_Reader</em> and give the excel file which you like to read.<br />
<code><br />
$xls = new Spreadsheet_Excel_Reader();<br />
$xls->read('indiastamps_yearsets.xls');<br />
</code><br />
All the rows and columns can be accessed through array variable <em>sheets</em>. We use two <em>for</em> loops to access each and every element of the sheet0.<br />
<code>$xls->sheets[0]['cells'][$row][$column]</code></p>
<p align="center">Result<br/>

			    <a href="http://itgeek.in/wp-content/uploads/2009/06/excel2.jpg" class="highslide"  onclick="return hs.expand(this, {captionId: 'caption-for-P2491'})"> 
                <img src="http://itgeek.in/wp-content/uploads/2009/06/excel2-272x300.jpg" alt="Result" border="0" id="P2491" title="Result" /></a> 
								<div class='highslide-caption' id='caption-for-P2491'>
			       		
	     				    	<a href="#" onclick="hs.close(this)" class="highslide-close">Close</a>   	
				<div style="clear:both">Result</div>
	
			    </div>

</p>
<p>If you are Microsoft Excel 2007 user, be sure about saving file in 1997-2003 .xls format else it will not work. Thanks for reading. <img src='http://itgeek.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://itgeek.in/php/reading-excel-spreadsheets-with-php.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Track Geolocation of visitors: PHP and IP-to-Country Database</title>
		<link>http://itgeek.in/php/track-geolocation-of-visitors-php-and-ip-to-country-database.html</link>
		<comments>http://itgeek.in/php/track-geolocation-of-visitors-php-and-ip-to-country-database.html#comments</comments>
		<pubDate>Wed, 03 Jun 2009 17:28:12 +0000</pubDate>
		<dc:creator>Charandeep Singh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[bloggers]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[ip address]]></category>
		<category><![CDATA[ip number]]></category>
		<category><![CDATA[iplocator]]></category>
		<category><![CDATA[iptocountry]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[statcounter]]></category>
		<category><![CDATA[track ip]]></category>
		<category><![CDATA[webmasters]]></category>

		<guid isPermaLink="false">http://itgeek.in/?p=147</guid>
		<description><![CDATA[Geolocation is a geographical location of peer computer connected with some network i.e. local, or internet. That location can be anywhere in the world. When a computer gets connected to any network, a unique IP address is allocated and assigned to it, which uniquely identifies its identity on that network. IP address is a 32-bit [...]]]></description>
			<content:encoded><![CDATA[<p>Geolocation is a geographical location of peer computer connected with some network <em>i.e. local, or internet</em>. That location can be anywhere in the world. When a computer gets connected to any network, a unique IP address is allocated and assigned to it, which uniquely identifies its identity on that network. IP address is a 32-bit number which is divided into 4 sections, each section is separated with a dot, and contain any number from 0-255. An IP address is very sensitive and complex to grab it all. It contains all the required information like <em>network, location, host</em> of the computer.</p>
<p>Webmasters and Bloggers are always interested to see whom visiting there site, where they came from, etc. There are some free tools on web to track your visitors. <a href="http://www.google.com/analytics/" target="_blank">Google Analytics</a> and <a href="http://www.statcounter.com" target="_blank">Statcounter</a> are two most popular and accurate tools for visitor tracking. They extract information like region, city, country, referral, ISP, etc from an IP address and provide us processed information in form of graphical components like chart, graphs and pie.</p>
<p>If you are interested to make such tool or you want to use it in your own way, here is the procedure to do it.  <span id="more-147"></span></p>
<p>In this tutorial, I&#8217;ll be assuming that you have little knowledge of PHP.<br />
First of all, download the latest IP-to-Country CSV format database from <a href="http://ip-to-country.webhosting.info/node/view/6" target="_blank">here</a>. CSV file consist of 5 fields begin IP number, ending IP number, 2-digit country code, 3-digit country code and country name. Eg.<br />
<code>"33996344","33996351","GB","GBR","UNITED KINGDOM"<br />
"50331648","69956103","US","USA","UNITED STATES"<br />
"69956104","69956111","BM","BMU","BERMUDA"</code><br />
The range of record in which IP number will lies, that record will contain the other information like country name. Now, What is an IP number ? Is this same as the IP address. No, IP number is a number which is extracted from the IP address using a following formula, lets have a example if we have an IP address a.b.c.d, formula would be:<br />
<code>$ip_number = a x 16777216 + b x 65536 + c x 256 + d;</code></p>
<p>Well, we have discussed how it will work, now we will get to real stuff Lets! code it!</p>
<p><a href="http://itgeek.in/wp-content/uploads/2009/06/iplocator-10.zip">Download IP Locator 1.0</a>, IP Locator is a small package, which allows programmer to use only just one function <em>i.e. GetField();</em> for all the required operations.</p>
<p>Firstly include <em>csv.php</em> in your code:<br />
<code>require_once ('csv.php');</code></p>
<p>Below code shows three different ways of using <em>GetField()</em> function:<br />
<code>$two_digit_code = GetField('twodigitcode');<br />
$three_digit_code = GetField('threedigitcode');<br />
$country = GetField('country');</code><br />
An example <em>index.php</em> is included to package, which shows the use of IP Locator in detail. Also noted that CSV database is split into 7 different files, for the faster processing and reduce the server load. Package contain the IP-to-Country database from <a href="http://ip-to-country.webhosting.info/">http://ip-to-country.webhosting.info/</a> and the flags from <a href="http://www.ip2location.com/flagsoftheworld.aspx">www.ip2location.com</a>.</p>
<blockquote><p><b>Note:</b> IPLocator v2.0 is available which now detects city, country, latitude, longitude, browser, OS etc and locate the user location in Google Maps. See the <a href="http://itgeek.in/tools/iplocator">demo here</a>. If you wish to buy this, contact me <a href="mailto:hireitgeek@gmail.com">hireitgeek@gmail.com</a>.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://itgeek.in/php/track-geolocation-of-visitors-php-and-ip-to-country-database.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
