<?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>Geekinator.com &#187; Servers</title>
	<atom:link href="http://www.geekinator.com/category/servers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geekinator.com</link>
	<description></description>
	<lastBuildDate>Sat, 29 Oct 2011 14:49:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Save output of print_r to variable instead of displaying it</title>
		<link>http://www.geekinator.com/2011/01/24/save-output-of-print_r-to-variable-instead-of-displaying-it/</link>
		<comments>http://www.geekinator.com/2011/01/24/save-output-of-print_r-to-variable-instead-of-displaying-it/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 23:36:45 +0000</pubDate>
		<dc:creator>geekinator</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[output]]></category>
		<category><![CDATA[print_r]]></category>
		<category><![CDATA[variable]]></category>

		<guid isPermaLink="false">http://www.geekinator.com/?p=151</guid>
		<description><![CDATA[I found this on someone else&#8217;s site (at http://www.electrictoolbox.com/return-information-from-php-print-r/) and thought I&#8217;d share it here as well. Something I&#8217;ve been wondering about for years and never really figured out how to do, was how to save the output of the print_r command to a variable, instead of actually displaying the contents to the screen. As [...]]]></description>
			<content:encoded><![CDATA[<p>I found this on someone else&#8217;s site (at <a href="http://www.electrictoolbox.com/return-information-from-php-print-r/" target="_blank">http://www.electrictoolbox.com/return-information-from-php-print-r/</a>) and thought I&#8217;d share it here as well.</p>
<p>Something I&#8217;ve been wondering about for years and never really figured out how to do, was how to save the output of the print_r command to a variable, instead of actually displaying the contents to the screen.</p>
<p>As it turns out, it&#8217;s extremely easy to do. You simply need to set the output of print_r to a variable, and then add a 2nd parameter to the print_r function, of true. For instance: $my_var = print_r($my_array,true);</p>
<p>Then, instead of actually displaying the contents of the array, your nicely formatted array output is saved to the variable $my_var, to be used however you wish.</p>
<p>In my case, I was wanting to save the output to a text file, for a project I&#8217;m working on, and then use the data inside the array later on in the project&#8230;instead of dealing with the data right away.</p>
<p>Works great, and thanks to the original author for sharing that useful info.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekinator.com/2011/01/24/save-output-of-print_r-to-variable-instead-of-displaying-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Want to speed up your coding? Give a framework a try!</title>
		<link>http://www.geekinator.com/2010/08/24/want-to-speed-up-your-coding-give-a-framework-a-try/</link>
		<comments>http://www.geekinator.com/2010/08/24/want-to-speed-up-your-coding-give-a-framework-a-try/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 16:28:04 +0000</pubDate>
		<dc:creator>geekinator</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.geekinator.com/?p=105</guid>
		<description><![CDATA[I&#8217;ve been working with PHP for about 10 years now, and the one problem I&#8217;ve always had was keeping my code organized and how to reuse my code efficiently. Well, a couple of years ago, I ran across some information about using frameworks to help speed up the coding process. I&#8217;m always a big fan [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with PHP for about 10 years now, and the one problem I&#8217;ve always had was keeping my code organized and how to reuse my code efficiently. Well, a couple of years ago, I ran across some information about using frameworks to help speed up the coding process. I&#8217;m always a big fan of making things easier, even if it&#8217;s &#8220;not the way most people would do it&#8221; or &#8220;not the way a professional would do it&#8221;&#8230;forget that, I say whatever gets the job done is what wins!</p>
<p>There are many frameworks to choose from for pretty much any scripting or programming language. Because I mainly code my web apps in PHP, I decided to first try <a href="http://www.codeigniter.com" target="_blank">CodeIgniter</a> because it seemed simple enough. Well, it turned out to be far too simple for me, because I was looking for something that took care of a lot of the heavy lifting for me. I don&#8217;t like reinventing the wheel&#8230;if it&#8217;s already done and it works, why not use it. I&#8217;m not going to go into all the details about the features CodeIgniter offers, but their website has very good documentation if you want to learn about it. Once I tried CodeIgniter and found it to be too limited for my tastes (I&#8217;m not saying it&#8217;s not a good framework, but I would recommend it to someone who really wants to code most of the logic themselves), I decided to give another framework, named <a href="http://www.cakephp.org" target="_blank">CakePHP</a>, a try.</p>
<p>CakePHP turned out to be a huge time saver in most areas for me. Not only does it help me keep my code well organized, because of the <a href="http://en.wikipedia.org/wiki/Model%E2%80%93View%E2%80%93Controller" target="_blank">MVC</a> (model, view, controller) structure, but there are tons of functions included with the release that help with the most common and some advanced features. I&#8217;m still learning the ins and outs of designing an app using the MVC approach, because it&#8217;s very alien to me since I&#8217;ve always been a pretty unorganized coder, but I&#8217;m getting there. With time, I think it may force me to become a better programmer overall.</p>
<p>So, if you&#8217;re like me and are having trouble keeping your code organized or just want something to make building dynamic web apps easier, give a framework a try&#8230;you may just be surprised at how much easier it is to develop your apps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekinator.com/2010/08/24/want-to-speed-up-your-coding-give-a-framework-a-try/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clicky Stats &#8211; The Best Web Stats ever!</title>
		<link>http://www.geekinator.com/2010/04/06/clicky-stats-the-best-web-stats-ever/</link>
		<comments>http://www.geekinator.com/2010/04/06/clicky-stats-the-best-web-stats-ever/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 00:17:43 +0000</pubDate>
		<dc:creator>geekinator</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[clicky]]></category>
		<category><![CDATA[clicky stats]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[stats]]></category>

		<guid isPermaLink="false">http://www.geekinator.com/?p=91</guid>
		<description><![CDATA[My company owns a lot of domain names, and we have created various sites to host on those domains over the years. The one problem we&#8217;ve always had was trying to figure out the best web stats software to use on all of these sites. I&#8217;ve tried Google Analytics, which is ok but very limiting [...]]]></description>
			<content:encoded><![CDATA[<p>My company owns a lot of domain names, and we have created various sites to host on those domains over the years. The one problem we&#8217;ve always had was trying to figure out the best web stats software to use on all of these sites. I&#8217;ve tried Google Analytics, which is ok but very limiting in my opinion, as far as being able to back them up, search, etc. I&#8217;ve also tried awstats and webalizer, but found them really technical. Yes, I said &#8220;technical&#8221;&#8230;even the geekinator gets confused with technology sometimes : ). I thought I had hit the motherload when I found <a href="http://piwik.org/" target="_blank">Piwik Stats</a>, which is a free Open Source web analytics script. It has some really great features, and is really simple to use, but unfortunately for me, it doesn&#8217;t seem to work that great when you&#8217;re trying to track a ton of websites on a single server. The processing script takes hours and hours to process the traffic on all my sites, and was kind of glitchy when dealing with that amount of data. I would get strange, random, results. I&#8217;m sure Piwik is a great solution for someone who only needs to track up to a few sites, but that wasn&#8217;t me. I decided I really just needed a service that hosted the tracking software, and used their server for processing the data.</p>
<p>I had almost given up and just put Google Analytics on each site, so at least I have something tracking visitors&#8230;.something&#8217;s always better than nothing. Then, one day, I started to get frustrated with having to create a ton of accounts, under a single google login, in order: to track the hundreds of domains that I own. I though to myself &#8220;There has to be a better way, without me having to create my own script. I really don&#8217;t want to reinvent the wheel if I absolutely don&#8217;t have to&#8221;. A few hours of searching, finally brought <a title="Clicky Web Stats" href="http://getclicky.com/158114" target="_blank">Clicky Stats</a> to my attention!</p>
<p>Clicky Stats is available at <a href="http://getclicky.com/158114" target="_blank">http://getclicky.com</a>, and is HANDS DOWN the absolute best web site visitor tracking service/script I have ever had the pleasure of using! You may be asking yourself, &#8220;Well, ok, what does Clicky do?&#8221;. My response to you would be, What doesn&#8217;t Clicky do?!? This software is amazing, and lets you have control of your stats, instead of leaving you wondering how you&#8217;ll be able to use the stats.</p>
<p>First off, the creator of Clicky Stats, wrote a really simple and powerful API to allow anyone to access their stats in any format they want. Yes, there are other web stats packages out there that offer an API as well, and that&#8217;s all fine and dandy, except I&#8217;ve never used one that&#8217;s so easy to use. Second, Clicky gives you every piece of data under the sun about the user. Lets run down the feature list, if I may (Get ready for this&#8230;it&#8217;s a huge list : ) ):</p>
<ul>
<li>Customizable dashboard that displays data about the current day</li>
<li>List of visitors for the requested date period</li>
<li>How many actions each user took while on your site (i.e. how many links they clicked/pages they viewed)</li>
<li>How long each visitor spent on the site</li>
<li>The referring site/search engine, plus any search query they typed in to find your site</li>
<li>Each visitor&#8217;s IP address, Hostname, ISP, Language, Location, Operating System, Web Browser, Screen Resolution, and whether or not they have Javascript enabled in their browser.</li>
<li>Action log of each individual visitor, which tells you in order which pages they visited on your site</li>
<li>List of the most active visitors on your site, along with their IP and how many visits they have had in a given date period</li>
<li>Traffic sources, broken up by searches, direct/bookmark, links, email, and social media</li>
<li>Web browsers used, broken up by browser version</li>
<li>Operating Systems used, broken up by operating system version</li>
<li>Mobile devices used, broken up by device version (i.e. iPhone, iPod touch, Blackberry, etc)</li>
<li>Screen Resolutions used</li>
<li>List of visitors&#8217; Country</li>
<li>List of visitors&#8217; Region (i.e. State or Province)</li>
<li>List of visitors&#8217; City</li>
<li>List of visitors&#8217; Language</li>
<li>List of visitors&#8217; Hostname and Organization (i.e. their ISP)</li>
<li>Global map of all the visitors for a given date period</li>
<li>Global map of recent visitors</li>
<li>List of all the pages visited, along with a hit count (I&#8217;d like to see a unique visitor count per page, but I can&#8217;t have it all I guess : ) )</li>
<li>List of all entrance pages, along with hit count</li>
<li>List of all exit pages, along with hit count</li>
<li>List of all downloaded files, along with hit count</li>
<li>List of all clicks (not sure exactly what this does)</li>
<li>List of incoming links (links that people clicked to bring them to your site. i.e. a link in forum post for instance. This has the exact url of the page the link was on)</li>
<li>List of domains that brought visitors to your site</li>
<li>List of outgoing links (external links that may exist on your site)</li>
<li>List of links that recently brought visitors to your site</li>
<li>Unique List of links that recently brought visitors to your site</li>
<li>List of short urls (i.e. clicky has a short url service, called clicky.me, which allows you to create a short link, that redirects to your page that has a long url. Tinyurl.com does this as well)</li>
<li>List of searches (through search engines) that brought visitors to your site, along with a visitor count</li>
<li>List of keywords typed in during those searches (basically, it splits the search phrase into individual words, and then gives you a visitor count per word)</li>
<li>List of search engines, along with their subdomains, that brought visitors to your site, including a visitor count from each domain.</li>
<li>List of recent searches that brought visitors to your site</li>
<li>Unique list of recent searches that brought visitors to your site</li>
<li>You can create goals for marketing that you can then track, to see if the marketing is working or not.</li>
<li>You can track advertisement campaigns as well. I&#8217;m not quite sure how you do that, since I&#8217;ve never played with that feature.</li>
<li>You can track traffic through your Twitter feed, if you like. Again, I&#8217;m not quite sure how that works, because I haven&#8217;t played with it.</li>
<li>My absolute favorite feature of Clicky, is the real time Spy feature. This thing is so cool&#8230;what it does, is show you an ajaxified (I&#8217;m guessing) map of real time traffic on your site! It shows a pin where the visitor is in the world, and what they&#8217;re searching for to find your site, along with what page they&#8217;re currently on or have been on. You can literally spend hours watching people mess around on your site&#8230;it&#8217;s really cool.</li>
<li>Another really useful feature, is the ability to setup scheduled email reports, that send you requested data from your stats, by day, week, or month.</li>
<li>You can also output selected data in CSV or XML format, which is really handy.</li>
<li>You can also track your feedburner account, if you have one.</li>
<li>Another feature that I really like is the ability to block your own IP address, so it doesn&#8217;t count your personal visits.</li>
<li>Last, but not least, are the widgets. There are multiple widgets that allow you to display certain traffic data on your site, if you would like to do so.</li>
</ul>
<p>There you have it&#8230;whewwww, that was a lot of typing! Anyway, I hope you get my point. Clicky is the most useful tracking software I have ever found. If you know of something better or similar, please let me know.</p>
<p>I have to say, the pricing is fantastic as well. I won&#8217;t say what my monthly fee is, but I can tell you it&#8217;s way more than fair. Here&#8217;s a link to their standard <a href="http://getclicky.com/help/pricing" target="_blank">pricing page</a>. I was given a custom price, because I have a lot more domains than they show on the price page.</p>
<p>If you&#8217;d like to check out Clicky, and signup for an account, <a href="http://getclicky.com/158114" target="_blank">click here</a>. You can even try it out with a FREE account, which limits the features and amount of data, etc, but you can get a great idea of what Clicky has to offer your site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekinator.com/2010/04/06/clicky-stats-the-best-web-stats-ever/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speed up your PHP pages with Gzip!</title>
		<link>http://www.geekinator.com/2010/02/06/speed-up-your-php-pages-with-gzip/</link>
		<comments>http://www.geekinator.com/2010/02/06/speed-up-your-php-pages-with-gzip/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 00:51:52 +0000</pubDate>
		<dc:creator>geekinator</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://geekinator.com/?p=13</guid>
		<description><![CDATA[I can&#8217;t believe I haven&#8217;t learned about this little trick until recently, but I&#8217;m sure glad I learned it. A lot of you may already know this, but there&#8217;s a simple little tag you can add to the top of your PHP pages that will speed up the transfer of your site significantly, and on [...]]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t believe I haven&#8217;t learned about this little trick until recently, but I&#8217;m sure glad I learned it. A lot of you may already know this, but there&#8217;s a simple little tag you can add to the top of your PHP pages that will speed up the transfer of your site significantly, and on the fly. Don&#8217;t ask me how it works exactly, but I can tell you that it uses gzip compression (from what I have read) to automatically compress the output of your pages before it&#8217;s sent to the visitors&#8217; browser.</p>
<p>All you have to do is add the following line to the top of any php page you want to compress: ob_start(&#8220;ob_gzhandler&#8221;)</p>
<p>For example, if your page looks like this:</p>
<p>&lt;?php</p>
<p><!--p<--></p>
<p>echo &#8220;This is my page&#8221;;</p>
<p>?&gt;</p>
<p>Your finished, compressed, file would look like:</p>
<p>&lt;?php</p>
<p><!--p<--></p>
<p>ob_start(&#8220;ob_gzhandler&#8221;)</p>
<p>echo &#8220;This is my page&#8221;;</p>
<p>?&gt;</p>
<p>I also read somewhere (and if I can find the post again, I&#8217;ll update this post to give that person credit), that you should add an if statement around that line to make sure the visitor&#8217;s browser supports gzip. I&#8217;m not sure if it&#8217;s absolutely necessary these days, but I added it just to be safe. So, the line I add to my files is:</p>
<p>if(!ob_start(&#8220;ob_gzhandler&#8221;)){ ob_start(); }</p>
<p>Now, I&#8217;m not an expert at compression or anything, but it works and that&#8217;s good enough for me until I find out there&#8217;s some sort of problem with doing it that way. By the way, you can test your page to see if the gzip is actually working or not by going to <a href="http://www.whatsmyip.org/http_compression/" target="_blank">http://www.whatsmyip.org/http_compression/</a>. Another thing I should mention is your server has to have the zlib php library installed and active. You can read more about that at <a href="http://php.net/manual/en/book.zlib.php" target="_blank">http://php.net/manual/en/book.zlib.php</a></p>
<p>On most of my large files, I was able to compress the output by as much as 90% in some cases. The larger your output is, the higher compression you&#8217;ll achieve. I&#8217;m not sure if this is the &#8220;correct&#8221; way of adding the compression to wordpress, but all I did was add the line to the header.php file in my template. I tested the site and it&#8217;s gzipped!</p>
<p>Of course, there&#8217;s also the added bonus (more likely the reason you&#8217;d want to do this for a really large site) of saving on your bandwidth usage. For really large sites, the cost of bandwith can be pretty large, but I think I like the idea of it speeding up the site for my visitors even more than the bandwith savings.</p>
<p>I hope that helped everyone as much as it helped me. Thanks to the guys over at WhatsMyIp.org for the information.</p>
<p><strong>EDIT: </strong>I didn&#8217;t know this until a few days after posting the php code, but you can also gzip an entire site  using .htaccess (at least the html output of the site anyway). All you have to do is add these 2 lines to your .htaccess file:</p>
<p>php_value output_buffering On<br />
php_value output_handler ob_gzhandler</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekinator.com/2010/02/06/speed-up-your-php-pages-with-gzip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

