<?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>Open Source Web</title>
	<atom:link href="http://www.open-source-web.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.open-source-web.com</link>
	<description>Your open source for Development and Design</description>
	<lastBuildDate>Mon, 01 Apr 2013 20:45:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Auto update multiple installs of WordPress with cron/ssh via bash script</title>
		<link>http://www.open-source-web.com/php/auto-update-multiple-installs-of-wordpress-with-cronssh-via-bash-script/</link>
		<comments>http://www.open-source-web.com/php/auto-update-multiple-installs-of-wordpress-with-cronssh-via-bash-script/#comments</comments>
		<pubDate>Mon, 01 Apr 2013 20:45:44 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=207</guid>
		<description><![CDATA[With WordPress being updated more frequently than ever with new security fixes and features it&#8217;s important to keep you site up to date with the lates version of WordPress. Running one update is easy and quick enough but if you have a dozen or more WordPress sites on one server you can update them all &#8230; <a href="http://www.open-source-web.com/php/auto-update-multiple-installs-of-wordpress-with-cronssh-via-bash-script/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/php/auto-update-multiple-installs-of-wordpress-with-cronssh-via-bash-script/" data-twtext="Auto update multiple installs of WordPress with cron/ssh via bash script" data-shareurl="http://www.open-source-web.com/php/auto-update-multiple-installs-of-wordpress-with-cronssh-via-bash-script/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>With WordPress being updated more frequently than ever with new security fixes and features it&#8217;s important to keep you site up to date with the lates version of WordPress.</p>
<p>Running one update is easy and quick enough but if you have a dozen or more WordPress sites on one server you can update them all at once with a very simple bash script.</p>
<p>This script can be used in one of two ways:</p>
<p>1:  Setup the script and run it every time a new version of Wordpres is released</p>
<p>2: Setup a cron task to run the update weekly, this will mean you never have to worry about out of date versions of WP ever again.</p>
<p>It works by using wget to download the latest version and unzip it&#8217;s files to each of your WordPress installs.</p>
<pre>#!/bin/bash

wget -q http://wordpress.org/latest.tar.gz -O /var/www/latest.tar.gz; 

tar zxf /var/www/latest.tar.gz /var/www/;
cp -r /var/www/wordpress/* /var/www/example.com/htdocs;
cp -r /var/www/wordpress/* /var/www/example.co.uk/htdocs;
cp -r /var/www/wordpress/* /var/www/test.com/htdocs;</pre>
<p>Note:  If all the sites on your server are running WordPress you could replace the individual cp lines with a loop to go through folders but to keep it simple and stop errors I&#8217;ve put a line in for each WP site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/php/auto-update-multiple-installs-of-wordpress-with-cronssh-via-bash-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu auto restart cron for Apache and Mysql after crash</title>
		<link>http://www.open-source-web.com/apache/ubuntu-auto-restart-cron-for-apache-and-mysql-after-crash/</link>
		<comments>http://www.open-source-web.com/apache/ubuntu-auto-restart-cron-for-apache-and-mysql-after-crash/#comments</comments>
		<pubDate>Sat, 08 Dec 2012 10:10:55 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=193</guid>
		<description><![CDATA[Websites never sleep but you may want to, this script lets you do that without having to worry about Apache or Mysql crashing randomly. Obviously if you have reoccurring issues its best to check through the log files and fix any issues but this will help reduce down time on vital software crashes to less &#8230; <a href="http://www.open-source-web.com/apache/ubuntu-auto-restart-cron-for-apache-and-mysql-after-crash/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/apache/ubuntu-auto-restart-cron-for-apache-and-mysql-after-crash/" data-twtext="Ubuntu auto restart cron for Apache and Mysql after crash" data-shareurl="http://www.open-source-web.com/apache/ubuntu-auto-restart-cron-for-apache-and-mysql-after-crash/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>Websites never sleep but you may want to, this script lets you do that without having to worry about Apache or Mysql crashing randomly.</p>
<p>Obviously if you have reoccurring issues its best to check through the log files and fix any issues but this will help reduce down time on vital software crashes to less than a minute by checking for  Apache and Mysql services running and if none are found they get restarted.</p>
<p>Save this into a .sh file somewhere on your server and run this every minute usinng the built in Ubuntu Cron. If you are using a different OS and this doesn&#8217;t work replace the restart commands.</p>
<p>&nbsp;</p>
<pre>
#!/bin/bash

# APACHE SECTION
RESTART="/etc/init.d/apache2 restart"
PGREP="/usr/bin/pgrep"
HTTPD="apache"
$PGREP ${HTTPD}
if [ $? -ne 0 ]
then
$RESTART
fi

# MYSQL SECTION
RESTARTM="/etc/init.d/mysql restart"
MYSQLD="mysqld"
$PGREP ${MYSQLD}
if [ $? -ne 0 ]
then
$RESTARTM
fi
</pre>
<p>&nbsp;</p>
<p>To improve this script you could add email notifications and other vital services like sendmail which if they go down may be less apparent.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/apache/ubuntu-auto-restart-cron-for-apache-and-mysql-after-crash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache MaxClients</title>
		<link>http://www.open-source-web.com/apache/apache-maxclients/</link>
		<comments>http://www.open-source-web.com/apache/apache-maxclients/#comments</comments>
		<pubDate>Sun, 26 Jun 2011 06:46:35 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=189</guid>
		<description><![CDATA[Working with Ubuntu or any other Linux distribution you really do learn something new every day. Yesterday one of my servers looked like Apache had Crashed. Symptoms: Loading a web page wont return a 404 or 500 error just a blank page Restarting Apache will help for a minute or two It&#8217;s a reoccurring issue &#8230; <a href="http://www.open-source-web.com/apache/apache-maxclients/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/apache/apache-maxclients/" data-twtext="Apache MaxClients" data-shareurl="http://www.open-source-web.com/apache/apache-maxclients/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>Working with Ubuntu or any other Linux distribution you really do learn something new every day. Yesterday one of my servers looked like Apache had Crashed.</p>
<p>Symptoms:</p>
<ul>
<li>Loading a web page wont return a 404 or 500 error just a blank page</li>
<li>Restarting Apache will help for a minute or two</li>
<li>It&#8217;s a reoccurring issue</li>
<li>Happens when you have large spikes in traffic</li>
</ul>
<p>Like most things in Linux it&#8217;s an easy fix as long as you know where to look.</p>
<p>To double check this is the issue load up the Apache Log, in Ubuntu it&#8217;s /var/log/apache2/error.log</p>
<p>You should see something like :</p>
<p>[Sat Jun 25 14:14:17 2011] [error] server reached MaxClients setting, consider raising the MaxClients setting</p>
<p>To resolve this issue go to /etc/apache2/apache2.conf and change the MaxClients settings from to a higher number. By default it&#8217;s 10 and I would recommend changing it to about 30+ if it&#8217;s shutting down at 10 requests. You will also need to restart Apache after you change the setting.</p>
<p><a title="Apache MaxCLients" href="http://httpd.apache.org/docs/2.0/mod/mpm_common.html#maxclients" target="_blank">More information from Apache on MaxClients</a></p>
<div id="_mcePaste" class="mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 144px; width: 1px; height: 1px;">
<table class="Bs nH iY" cellpadding="0">
<tbody>
<tr>
<td class="Bu">
<div class="nH if">
<div class="nH">
<div class="nH">
<h1 class="ha"><span id=":96" class="hP">Re: [#MQV-17419-739] nothing works</span></h1>
<table class="cf hX" cellpadding="0">
<tbody>
<tr class="hY hM">
<td class="hT hM"></td>
<td class="hU hM" style="background-color: #eeeeee;"></td>
<td class="hS hM" style="background-color: #eeeeee;"></td>
<td class="hV hM" style="background-color: #eeeeee;"></td>
<td class="hW hM"></td>
</tr>
<tr class="hR">
<td class="hT hU hM" style="background-color: #eeeeee;"></td>
<td class="hU hM" style="background-color: #eeeeee; color: #222222;"></td>
<td class="hS hM" style="background-color: #222222;"></td>
<td class="hV hM" style="background-color: #eeeeee; color: #222222;"><span class="hO" title="Mark as not important">X</span></td>
<td class="hW hV hM" style="background-color: #eeeeee;"></td>
</tr>
<tr class="hY hM">
<td class="hT hM"></td>
<td class="hU hM" style="background-color: #eeeeee;"></td>
<td class="hS hM" style="background-color: #eeeeee;"></td>
<td class="hV hM" style="background-color: #eeeeee;"></td>
<td class="hW hM"></td>
</tr>
</tbody>
</table>
<table class="cf hX" cellpadding="0">
<tbody>
<tr class="hY hM">
<td class="hT hM"></td>
<td class="hU hM" style="background-color: #eeeeee;"></td>
<td class="hS hM" style="background-color: #eeeeee;"></td>
<td class="hV hM" style="background-color: #eeeeee;"></td>
<td class="hW hM"></td>
</tr>
<tr class="hR">
<td class="hT hU hM" style="background-color: #eeeeee;"></td>
<td class="hU hM" style="background-color: #eeeeee; color: #222222;">
<div class="hN" title="Search for all messages with label Inbox">Inbox</div>
</td>
<td class="hS hM" style="background-color: #222222;"></td>
<td class="hV hM" style="background-color: #eeeeee; color: #222222;"><span class="hO" title="Remove label Inbox from this conversation">X</span></td>
<td class="hW hV hM" style="background-color: #eeeeee;"></td>
</tr>
<tr class="hY hM">
<td class="hT hM"></td>
<td class="hU hM" style="background-color: #eeeeee;"></td>
<td class="hS hM" style="background-color: #eeeeee;"></td>
<td class="hV hM" style="background-color: #eeeeee;"></td>
<td class="hW hM"></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="nH">
<div class="nH hx">
<div class="nH">
<div class="kv  ">
<div class="Bk">
<div class="G3 G2">
<div>
<div id=":7a">
<div class="FL1GFc">
<div class="hF hH"><img class="hG" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></div>
<div class="gs gt">
<div class="gE hI">
<table class="cf gJ" cellpadding="0">
<tbody>
<tr>
<td class="gF gK" style="width: auto;"><span class="lHQn1d"><img class=" f g8 " src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></span><span class="ik"><img id="upi" class="de QrVm3d" src="https://mail.google.com/mail/images/cleardot.gif" alt="" width="16px" height="16px" /></span><span class="gD" style="color: #00681c;">WizzVPS Support</span></td>
<td class="gF gK">
<table class="cf iB" cellpadding="0">
<tbody>
<tr>
<td>
<div class="iA g6">Thank you for your email with subject nothing works. Your request has been as&#8230;</div>
</td>
</tr>
</tbody>
</table>
</td>
<td class="gH">
<div class="gK"><span id=":8c" class="g3" title="Sat, Jun 18, 2011 at 8:56 AM">Jun 18 (8 days ago)</span></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="kv hn ">
<div class="Bk">
<div class="G3 G2">
<div>
<div id=":8d">
<div class="FL1GFc">
<div class="hF hH"><img class="hG" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></div>
<div class="gs gt">
<div class="gE hI">
<table class="cf gJ" cellpadding="0">
<tbody>
<tr>
<td class="gF gK" style="width: auto;"><span class="lHQn1d"><img class=" f g8 " src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></span><span class="ik"><img id="upi" class="de QrVm3d" src="https://mail.google.com/mail/images/cleardot.gif" alt="" width="16px" height="16px" /></span><span class="gD" style="color: #00681c;">Victor Inceu, WizzVPS Support</span></td>
<td class="gF gK">
<table class="cf iB" cellpadding="0">
<tbody>
<tr>
<td>
<div class="iA g6">Hello, I have checked your system status and sshd daemon appears to be runnin&#8230;</div>
</td>
</tr>
</tbody>
</table>
</td>
<td class="gH">
<div class="gK"><span id=":8e" class="g3" title="Sat, Jun 18, 2011 at 9:10 AM">Jun 18 (8 days ago)</span></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="kv hn ">
<div class="Bk">
<div class="G3 G2">
<div>
<div id=":8f">
<div class="FL1GFc">
<div class="hF hH"><img class="hG" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></div>
<div class="gs gt">
<div class="gE hI">
<table class="cf gJ" cellpadding="0">
<tbody>
<tr>
<td class="gF gK" style="width: auto;"><span class="lHQn1d"><img class=" f g8 " src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></span><span class="ik"><img id="upi" class="c6 QrVm3d" src="https://mail.google.com/mail/images/cleardot.gif" alt="" width="16px" height="16px" /></span><span class="gD" style="color: #5b1094;">Adrian Mursec</span></td>
<td class="gF gK">
<table class="cf iB" cellpadding="0">
<tbody>
<tr>
<td>
<div class="iA g6">Hi What does the repair mode actually do, I&#8217;m trying to reset the server to t&#8230;</div>
</td>
</tr>
</tbody>
</table>
</td>
<td class="gH">
<div class="gK"><span id=":8g" class="g3" title="Sat, Jun 18, 2011 at 9:35 AM">Jun 18 (8 days ago)</span></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="kv hn ">
<div class="Bk">
<div class="G3 G2">
<div>
<div id=":8h">
<div class="FL1GFc">
<div class="hF hH"><img class="hG" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></div>
<div class="gs gt">
<div class="gE hI">
<table class="cf gJ" cellpadding="0">
<tbody>
<tr>
<td class="gF gK" style="width: auto;"><span class="lHQn1d"><img class=" f g8 " src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></span><span class="ik"><img id="upi" class="de QrVm3d" src="https://mail.google.com/mail/images/cleardot.gif" alt="" width="16px" height="16px" /></span><span class="gD" style="color: #00681c;">Victor Inceu, WizzVPS Support</span></td>
<td class="gF gK">
<table class="cf iB" cellpadding="0">
<tbody>
<tr>
<td>
<div class="iA g6">Hi Adrian, With regards to the &#8216;Repair&#8217; mode, please note that this won&#8217;t rei&#8230;</div>
</td>
</tr>
</tbody>
</table>
</td>
<td class="gH">
<div class="gK"><span id=":8i" class="g3" title="Sat, Jun 18, 2011 at 10:04 AM">Jun 18 (8 days ago)</span></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="kv hn ">
<div class="Bk">
<div class="G3 G2">
<div>
<div id=":8j">
<div class="FL1GFc">
<div class="hF hH"><img class="hG" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></div>
<div class="gs gt">
<div class="gE hI">
<table class="cf gJ" cellpadding="0">
<tbody>
<tr>
<td class="gF gK" style="width: auto;"><span class="lHQn1d"><img class=" f g8 " src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></span><span class="ik"><img id="upi" class="c6 QrVm3d" src="https://mail.google.com/mail/images/cleardot.gif" alt="" width="16px" height="16px" /></span><span class="gD" style="color: #5b1094;">Adrian Mursec</span></td>
<td class="gF gK">
<table class="cf iB" cellpadding="0">
<tbody>
<tr>
<td>
<div class="iA g6">Hi My websites don&#8217;t seem to load some times, Apache2 is still running and it&#8230;</div>
</td>
</tr>
</tbody>
</table>
</td>
<td class="gH">
<div class="gK"><span id=":8k" class="g3" title="Sat, Jun 25, 2011 at 2:12 PM">2:12 PM (17 hours ago)</span></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="h7 hn ">
<div class="Bk">
<div class="G3 G2">
<div class="G0">
<div class="J-J5-Ji">
<div class="J-K-I J-J5-Ji J-K-I-Js-Zj GZ L3">
<div class="J-J5-Ji J-K-I-Kv-H">
<div class="J-J5-Ji J-K-I-J6-H">
<div class="J-K-I-KC">
<div class="J-K-I-K9-KP"></div>
<div class="J-K-I-Jz"><img class="hB" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /><span class="hE">Reply</span></div>
</div>
</div>
</div>
</div>
</div>
<div class="J-J5-Ji">
<div id=":2n" class="J-K-I J-J5-Ji G1 J-K-I-Js-Zq GZ L3">
<div class="J-J5-Ji J-K-I-Kv-H">
<div class="J-J5-Ji J-K-I-J6-H">
<div class="J-K-I-KC">
<div class="J-K-I-K9-KP"></div>
<div class="J-K-I-Jz"><img class="hA" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /><span style="visibility: hidden;">|</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div id=":8l">
<div class="FL1GFc" style="display: none;">
<div class="hF hH"><img class="hG" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></div>
<div class="gs gt">
<div class="gE hI">
<table class="cf gJ" cellpadding="0">
<tbody>
<tr>
<td class="gF gK" style="width: auto;"><span class="lHQn1d"><img class=" f g8 " src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></span><span class="ik"><img id="upi" class="de QrVm3d" src="https://mail.google.com/mail/images/cleardot.gif" alt="" width="16px" height="16px" /></span><span class="gD" style="color: #00681c;">Ioan Nistor, WizzVPS Support</span></td>
<td class="gF gK">
<table class="cf iB" cellpadding="0">
<tbody>
<tr>
<td>
<div class="iA g6">Hi Adrian, Something has to do with the sites, the maxclients value is reache&#8230;</div>
</td>
</tr>
</tbody>
</table>
</td>
<td class="gH">
<div class="gK"><span id=":8m" class="g3" title="Sat, Jun 25, 2011 at 2:21 PM">2:21 PM (17 hours ago)</span></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="HprMsc">
<div class="hF hH"><img class="hG" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></div>
<div class="gs">
<div class="gE iv gt">
<table class="cf gJ" cellpadding="0">
<tbody>
<tr>
<td class="gF gK">
<table class="cf ix" cellpadding="0">
<tbody>
<tr>
<td>
<div class="iw"><span class="lHQn1d"><img class=" f g8 " src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></span><span class="ik"><img id="upi" class="de QrVm3d" src="https://mail.google.com/mail/images/cleardot.gif" alt="" width="16px" height="16px" /></span><span class="gD" style="color: #00681c;">Ioan Nistor, WizzVPS Support</span> <span class="hb">to <span class="g2">me</span> </span></div>
</td>
</tr>
</tbody>
</table>
</td>
<td class="gH">
<div class="gK"><span class="iD">show details</span> <span id=":78" class="g3" title="Sat, Jun 25, 2011 at 2:21 PM">2:21 PM (17 hours ago)</span></div>
</td>
<td class="gH"></td>
</tr>
</tbody>
</table>
</div>
<div id=":83" class="ii gt">
<div id=":82">Hi Adrian,Something has to do with the sites, the maxclients value is reached pretty fast:</p>
<p>[Sat Jun 25 14:10:40 2011] [notice] Digest: generating secret for digest authentication &#8230;<br />
[Sat Jun 25 14:10:40 2011] [notice] Digest: done<br />
[Sat Jun 25 14:10:40 2011] [notice] Apache/2.2.14 (Ubuntu) DAV/2 SVN/1.6.6 mod_fcgid/2.3.4 PHP/5.3.2-1ubuntu4.9 with Suhosin-Patch mod_ruby/1.2.6 Ruby/1.8.7(2010-01-10) mod_ssl/2.2.14 OpenSSL/0.9.8k configured &#8212; resuming normal operations<br />
[Sat Jun 25 14:10:45 2011] [error] server reached MaxClients setting, consider raising the MaxClients setting<br />
[Sat Jun 25 14:13:13 2011] [notice] caught SIGTERM, shutting down<br />
[Sat Jun 25 14:14:12 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)<br />
[Sat Jun 25 14:14:12 2011] [notice] Digest: generating secret for digest authentication &#8230;<br />
[Sat Jun 25 14:14:12 2011] [notice] Digest: done<br />
[Sat Jun 25 14:14:12 2011] [notice] Apache/2.2.14 (Ubuntu) DAV/2 SVN/1.6.6 mod_fcgid/2.3.4 PHP/5.3.2-1ubuntu4.9 with Suhosin-Patch mod_ruby/1.2.6 Ruby/1.8.7(2010-01-10) mod_ssl/2.2.14 OpenSSL/0.9.8k configured &#8212; resuming normal operations<br />
[Sat Jun 25 14:14:17 2011] [error] server reached MaxClients setting, consider raising the MaxClients setting</p>
<p>Please try to review first the sites you are hosting or increase the value for maxclients in apache config.</p>
<p>Regards,</p>
<p>Ioan Nistor</p>
<div>
<div><span id="q_130c709c3b908596_1" class="h4">- Show quoted text -</span></div>
<div class="h5">Technical Support Engineer<br />
WizzVPS.comAny prices stated exclude VAT at 20% (where applicable to EEC customers) unless explicitly stated otherwise. E&amp;OE.</p>
<p>Access this ticket online: <a href="https://help.wizzvps.com/" target="_blank">https://help.wizzvps.com</a><br />
Follow us on Twitter: <a href="http://twitter.com/WizzVPS" target="_blank">http://twitter.com/WizzVPS</a></p>
<p>WizzVPS is a trading name of Layershift Limited</p>
<p>Layershift Limited | Delta House | Wavell Road | Manchester | M22 5QZ | UK<br />
Layershift Limited is a company registered in England and Wales (6036217). EU VAT number: GB 903 0349 62</p>
<p>=================================================================================<br />
This email is confidential. If you are not the intended recipient of this email, please notify Layershift Limited immediately. Any form of  reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, either in whole or in part, is strictly prohibited without permission from Layershift Limited.</p>
</div>
</div>
</div>
</div>
<div class="gA gt">
<div class="gB">
<table id=":2o" class="cf gz" cellpadding="0">
<tbody>
<tr>
<td>
<div class="cKWzSc mD"><img class="mL" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /> <span class="mG">Reply</span></div>
</td>
<td></td>
<td>
<div class="XymfBd mD"><img class="mI" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /> <span class="mG">Forward</span></div>
</td>
<td></td>
<td></td>
<td class="io"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="kv  ">
<div class="Bk">
<div class="G3 G2">
<div>
<div id=":8n">
<div class="FL1GFc">
<div class="hF hH"><img class="hG" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></div>
<div class="gs gt">
<div class="gE hI">
<table class="cf gJ" cellpadding="0">
<tbody>
<tr>
<td class="gF gK" style="width: auto;"><span class="lHQn1d"><img class=" f g8 " src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></span><span class="ik"><img id="upi" class="c6 QrVm3d" src="https://mail.google.com/mail/images/cleardot.gif" alt="" width="16px" height="16px" /></span><span class="gD" style="color: #5b1094;">Adrian Mursec</span></td>
<td class="gF gK">
<table class="cf iB" cellpadding="0">
<tbody>
<tr>
<td>
<div class="iA g6">Wow thanks for that, i&#8217;ve upped it to 50 for now and will do some research fo&#8230;</div>
</td>
</tr>
</tbody>
</table>
</td>
<td class="gH">
<div class="gK"><span id=":8o" class="g3" title="Sat, Jun 25, 2011 at 2:43 PM">2:43 PM (16 hours ago)</span></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="h7 hn ie nH oy8Mbf">
<div class="Bk">
<div class="G3 G2">
<div class="G0">
<div class="J-J5-Ji">
<div class="J-K-I J-J5-Ji J-K-I-Js-Zj GZ L3">
<div class="J-J5-Ji J-K-I-Kv-H">
<div class="J-J5-Ji J-K-I-J6-H">
<div class="J-K-I-KC">
<div class="J-K-I-K9-KP"></div>
<div class="J-K-I-Jz"><img class="hB" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /><span class="hE">Reply</span></div>
</div>
</div>
</div>
</div>
</div>
<div class="J-J5-Ji">
<div id=":3l" class="J-K-I J-J5-Ji G1 J-K-I-Js-Zq GZ L3">
<div class="J-J5-Ji J-K-I-Kv-H">
<div class="J-J5-Ji J-K-I-J6-H">
<div class="J-K-I-KC">
<div class="J-K-I-K9-KP"></div>
<div class="J-K-I-Jz"><img class="hA" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /><span style="visibility: hidden;">|</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div id=":8p">
<div class="HprMsc">
<div class="hF hH"><img class="hG" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></div>
<div class="gs">
<div class="gE iv gt">
<table class="cf gJ" cellpadding="0">
<tbody>
<tr>
<td class="gF gK">
<table class="cf ix" cellpadding="0">
<tbody>
<tr>
<td>
<div class="iw"><span class="lHQn1d"><img class=" f g8 " src="https://mail.google.com/mail/images/cleardot.gif" alt="" /></span><span class="ik"><img id="upi" class="de QrVm3d" src="https://mail.google.com/mail/images/cleardot.gif" alt="" width="16px" height="16px" /></span><span class="gD" style="color: #00681c;">Ioan Nistor, WizzVPS Support</span> <span class="hb">to <span class="g2">me</span> </span></div>
</td>
</tr>
</tbody>
</table>
</td>
<td class="gH">
<div class="gK"><span class="iD">show details</span> <span id=":7c" class="g3" title="Sat, Jun 25, 2011 at 2:45 PM">2:45 PM (16 hours ago)</span></div>
</td>
<td class="gH"></td>
</tr>
</tbody>
</table>
</div>
<div id=":8r" class="ii gt">
<div id=":8q">Apache logs under debian/ubuntu are in /var/log/apache2/ directory.</p>
<div>
<div><span id="q_130c71f6c2e6171b_1" class="h4">- Show quoted text -</span></div>
<div class="h5">Regards,Ioan Nistor<br />
Technical Support Engineer<br />
WizzVPS.com</p>
<p>Any prices stated exclude VAT at 20% (where applicable to EEC customers) unless explicitly stated otherwise. E&amp;OE.</p>
<p>Access this ticket online: <a href="https://help.wizzvps.com/" target="_blank">https://help.wizzvps.com</a><br />
Follow us on Twitter: <a href="http://twitter.com/WizzVPS" target="_blank">http://twitter.com/WizzVPS</a></p>
<p>WizzVPS is a trading name of Layershift Limited</p>
<p>Layershift Limited | Delta House | Wavell Road | Manchester | M22 5QZ | UK<br />
Layershift Limited is a company registered in England and Wales (6036217). EU VAT number: GB 903 0349 62</p>
<p>=================================================================================<br />
This email is confidential. If you are not the intended recipient of this email, please notify Layershift Limited immediately. Any form of  reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, either in whole or in part, is strictly prohibited without permission from Layershift Limited.</p>
</div>
</div>
</div>
</div>
<div class="gA gt">
<div class="gB">
<table id=":3k" class="cf gz" cellpadding="0">
<tbody>
<tr>
<td>
<div class="cKWzSc mD"><img class="mL" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /> <span class="mG">Reply</span></div>
</td>
<td></td>
<td>
<div class="XymfBd mD"><img class="mI" src="https://mail.google.com/mail/images/cleardot.gif" alt="" /> <span class="mG">Forward</span></div>
</td>
<td></td>
<td></td>
<td class="io"></td>
</tr>
</tbody>
</table>
<div class="ip iq"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="nH OH0apf">
<div class="z0DeRc">
<div style="float: left;"><a class="e jguvJ" href="http://pagead2.googlesyndication.com/aclk?sa=l&amp;ai=B80dBP9IGTsb0H4bIjQTWv_GAAajqz-QByPil3RjA4qmCDvD-jAEQARgBIIaPgAIoBDgAUJyBurf6_____wFgu46wg9AKoAGM4ZvxA7IBD21haWwuZ29vZ2xlLmNvbboBDmdtYWlsLWN2LWJlbG93yAEB2gH_AWh0dHA6Ly9tYWlsLmdvb2dsZS5jb20vTVRNM01Ua3pPVGcxT0RjMk1UTXhORGd3TWtOUFRFeEJVRk5GUkRFek56RTVOREEzTURrek5UazROVE00T0RWRFQweE1RVkJUUlVReE16Y3hPVFF5TXpFd056ZzRNVGt4TkRVM1EwOU1URUZRVTBWRU1UTTNNVGswTkRFeE1EZzFOamMyTWpjeU1rTlBURXhCVUZORlJERXpOekkxT1RNNU1UTXdOemsxTmpZMU5EWkRUMHhNUVZCVFJVUXhNemN5TlRrME5Ea3pOamc0TlRVNE5EQTJRMDlNVEVGUVUwVkVNVE0zTWpVNcgC4L_LBagDAegDpwboAyDoAwXoA64C9QMAAABE&amp;num=1&amp;sig=AGiWqtzcQSZSSNlo4oivcTVYdvE46QFvzw&amp;adurl=http://www.talend.com/download_form.php%3Fcont%3Dsfact%26lang%3Den%26utm_source%3Dgoogle%26utm_medium%3Dcpc%26utm_campaign%3DTLD:Application%2520Integration%2520Display:UK%26src%3DGoogleAdwordsRD_US%26kid%3Dnull%26utm_term%3Dmail.google.com%26utm_content%3DApache%2520CXF-4">Apache Services</a><a class="e jguvJ" href="http://pagead2.googlesyndication.com/aclk?sa=l&amp;ai=B80dBP9IGTsb0H4bIjQTWv_GAAajqz-QByPil3RjA4qmCDvD-jAEQARgBIIaPgAIoBDgAUJyBurf6_____wFgu46wg9AKoAGM4ZvxA7IBD21haWwuZ29vZ2xlLmNvbboBDmdtYWlsLWN2LWJlbG93yAEB2gH_AWh0dHA6Ly9tYWlsLmdvb2dsZS5jb20vTVRNM01Ua3pPVGcxT0RjMk1UTXhORGd3TWtOUFRFeEJVRk5GUkRFek56RTVOREEzTURrek5UazROVE00T0RWRFQweE1RVkJUUlVReE16Y3hPVFF5TXpFd056ZzRNVGt4TkRVM1EwOU1URUZRVTBWRU1UTTNNVGswTkRFeE1EZzFOamMyTWpjeU1rTlBURXhCVUZORlJERXpOekkxT1RNNU1UTXdOemsxTmpZMU5EWkRUMHhNUVZCVFJVUXhNemN5TlRrME5Ea3pOamc0TlRVNE5EQTJRMDlNVEVGUVUwVkVNVE0zTWpVNcgC4L_LBagDAegDpwboAyDoAwXoA64C9QMAAABE&amp;num=1&amp;sig=AGiWqtzcQSZSSNlo4oivcTVYdvE46QFvzw&amp;adurl=http://www.talend.com/download_form.php%3Fcont%3Dsfact%26lang%3Den%26utm_source%3Dgoogle%26utm_medium%3Dcpc%26utm_campaign%3DTLD:Application%2520Integration%2520Display:UK%26src%3DGoogleAdwordsRD_US%26kid%3Dnull%26utm_term%3Dmail.google.com%26utm_content%3DApache%2520CXF-4"> &#8211; </a><a class="e jguvJ" href="http://pagead2.googlesyndication.com/aclk?sa=l&amp;ai=B80dBP9IGTsb0H4bIjQTWv_GAAajqz-QByPil3RjA4qmCDvD-jAEQARgBIIaPgAIoBDgAUJyBurf6_____wFgu46wg9AKoAGM4ZvxA7IBD21haWwuZ29vZ2xlLmNvbboBDmdtYWlsLWN2LWJlbG93yAEB2gH_AWh0dHA6Ly9tYWlsLmdvb2dsZS5jb20vTVRNM01Ua3pPVGcxT0RjMk1UTXhORGd3TWtOUFRFeEJVRk5GUkRFek56RTVOREEzTURrek5UazROVE00T0RWRFQweE1RVkJUUlVReE16Y3hPVFF5TXpFd056ZzRNVGt4TkRVM1EwOU1URUZRVTBWRU1UTTNNVGswTkRFeE1EZzFOamMyTWpjeU1rTlBURXhCVUZORlJERXpOekkxT1RNNU1UTXdOemsxTmpZMU5EWkRUMHhNUVZCVFJVUXhNemN5TlRrME5Ea3pOamc0TlRVNE5EQTJRMDlNVEVGUVUwVkVNVE0zTWpVNcgC4L_LBagDAegDpwboAyDoAwXoA64C9QMAAABE&amp;num=1&amp;sig=AGiWqtzcQSZSSNlo4oivcTVYdvE46QFvzw&amp;adurl=http://www.talend.com/download_form.php%3Fcont%3Dsfact%26lang%3Den%26utm_source%3Dgoogle%26utm_medium%3Dcpc%26utm_campaign%3DTLD:Application%2520Integration%2520Display:UK%26src%3DGoogleAdwordsRD_US%26kid%3Dnull%26utm_term%3Dmail.google.com%26utm_content%3DApache%2520CXF-4">Quickly &amp; Easily Build Web Services</a></div>
<div style="float: right;"><span class="OhWjKf">Ad</span></div>
<div class="hQfrn" style="clear: both;"><span class="TltSaf">on Apache CXF w/ Talend Open Source</span></div>
<div style="clear: both;"><span dir="ltr"><a class="OZSD7d" dir="ltr" href="http://pagead2.googlesyndication.com/aclk?sa=l&amp;ai=B80dBP9IGTsb0H4bIjQTWv_GAAajqz-QByPil3RjA4qmCDvD-jAEQARgBIIaPgAIoBDgAUJyBurf6_____wFgu46wg9AKoAGM4ZvxA7IBD21haWwuZ29vZ2xlLmNvbboBDmdtYWlsLWN2LWJlbG93yAEB2gH_AWh0dHA6Ly9tYWlsLmdvb2dsZS5jb20vTVRNM01Ua3pPVGcxT0RjMk1UTXhORGd3TWtOUFRFeEJVRk5GUkRFek56RTVOREEzTURrek5UazROVE00T0RWRFQweE1RVkJUUlVReE16Y3hPVFF5TXpFd056ZzRNVGt4TkRVM1EwOU1URUZRVTBWRU1UTTNNVGswTkRFeE1EZzFOamMyTWpjeU1rTlBURXhCVUZORlJERXpOekkxT1RNNU1UTXdOemsxTmpZMU5EWkRUMHhNUVZCVFJVUXhNemN5TlRrME5Ea3pOamc0TlRVNE5EQTJRMDlNVEVGUVUwVkVNVE0zTWpVNcgC4L_LBagDAegDpwboAyDoAwXoA64C9QMAAABE&amp;num=1&amp;sig=AGiWqtzcQSZSSNlo4oivcTVYdvE46QFvzw&amp;adurl=http://www.talend.com/download_form.php%3Fcont%3Dsfact%26lang%3Den%26utm_source%3Dgoogle%26utm_medium%3Dcpc%26utm_campaign%3DTLD:Application%2520Integration%2520Display:UK%26src%3DGoogleAdwordsRD_US%26kid%3Dnull%26utm_term%3Dmail.google.com%26utm_content%3DApache%2520CXF-4">www.talend.com/apache_cxf</a></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/apache/apache-maxclients/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Spam Blocker</title>
		<link>http://www.open-source-web.com/php/php-spam-blocker/</link>
		<comments>http://www.open-source-web.com/php/php-spam-blocker/#comments</comments>
		<pubDate>Sat, 23 Oct 2010 15:18:14 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[API's]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[spam bot]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=187</guid>
		<description><![CDATA[If you have a problem with Bot user&#8217;s and spam in WordPress the best solution is setting up Akismet. It&#8217;s an easy to use plug-in that just needs an API key. For Bespoke websites there isn&#8217;t a one click plug-in but there is a super easy to use Bot database called BotScout with an API &#8230; <a href="http://www.open-source-web.com/php/php-spam-blocker/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/php/php-spam-blocker/" data-twtext="PHP Spam Blocker" data-shareurl="http://www.open-source-web.com/php/php-spam-blocker/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>If you have a problem with Bot user&#8217;s and spam in WordPress the best solution is setting up Akismet. It&#8217;s an easy to use plug-in that just needs an API key.</p>
<p>For Bespoke websites there isn&#8217;t a one click plug-in but there is a super easy to use Bot database called BotScout with an API that only requires a <a href="http://botscout.com/getkey.htm" target="_blank">key</a> and CURL.</p>
<p>Botscout is compatible a range of off the shelf PHP systems such as PHPBB.</p>
<p>The following function will return</p>
<ul>
<li>0 = Not a bot</li>
<li>1 = Is a bot</li>
<li>2 = Failed to check for some reason</li>
</ul>
<pre>function testSpam($XIP,$XUSER,$XMAIL){  /// IP,username,email
$botdata='';
$APIKEY = 'PxX19wq5uJWiIL8'; // your optional API key
$XMAIL =urlencode($XMAIL); // make the url compliant with urlencode()
$apiquery = "http://botscout.com/test/?multi&amp;mail=$XMAIL&amp;ip=$XIP&amp;key=$APIKEY"; // testing for an email address and IP

if(function_exists('file_get_contents')){
$returned_data = file_get_contents($apiquery);    // Use file_get_contents
}else{
$ch = curl_init($apiquery);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$returned_data = curl_exec($ch);
curl_close($ch);
}

if($returned_data==''){// sanity check
return 2;
}

$botdata = explode('|', $returned_data); // take the returned value and parse it (standard API, not XML)

if(substr($returned_data, 0,1) == '!'){// if the first character is an exclamation mark, an error has occurred
return 2;
}

if($botdata[3] &gt; 0 || $botdata[5] &gt; 0){  /// it must be spam bot
return 1;
}else{
return 0;
}

}

</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/php/php-spam-blocker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Music to code</title>
		<link>http://www.open-source-web.com/music/music-to-code/</link>
		<comments>http://www.open-source-web.com/music/music-to-code/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 19:08:19 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=180</guid>
		<description><![CDATA[I have been a developer for nearly a decade now and had a lot of developer friends. One thing we all have in common is a very strict taste in whatever music we listen to. A lot will listen to indie or Norwegian Death Folk music. But 90% of the PHP developers I know are &#8230; <a href="http://www.open-source-web.com/music/music-to-code/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/music/music-to-code/" data-twtext="Music to code" data-shareurl="http://www.open-source-web.com/music/music-to-code/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>I have been a developer for nearly a decade now and had a lot of developer friends. One thing we all have in common is a very strict taste in whatever music we listen to. A lot will listen to indie or Norwegian Death Folk music. But 90% of the PHP developers I know are heavy metal heads.</p>
<p>It&#8217;s nothing new that people like to listen to good music while working no matter what you do for a living, drivers, coders, cyborg maintenance directors&#8217;. Maybe it just helps people relax and concentrate.</p>
<p>Either way I wante to share one of the bands I&#8221;ve found really good recently. A Manchester based band called <a title="Stolen Peace Manchester" href="http://www.stolenpeace.co.uk">Stolen Peace</a>.</p>
<p><object style="height: 344px; width: 425px"><param name="movie" value="http://www.youtube.com/v/OUzMhZ5q7v8?version=3"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/OUzMhZ5q7v8?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></object></p>
<p><object style="height: 344px; width: 425px"><param name="movie" value="http://www.youtube.com/v/cMHyrrOA5iQ?version=3"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/cMHyrrOA5iQ?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></object></p>
<p><object style="height: 344px; width: 425px"><param name="movie" value="http://www.youtube.com/v/w7_Mj9kVMcY?version=3"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/w7_Mj9kVMcY?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/music/music-to-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy CSS compatability</title>
		<link>http://www.open-source-web.com/css/easy-css-compatability/</link>
		<comments>http://www.open-source-web.com/css/easy-css-compatability/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 09:26:16 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[ff]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[star]]></category>
		<category><![CDATA[underscore]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=175</guid>
		<description><![CDATA[For every web developer / designer the issues in earlier versions of IE can be a real pain. Even simple styling such as margins and padding can make a design look like it&#8217;s upside down. The obvious hacks for CSS involve using a separate style sheet and the old school &#60;!&#8211; if IE&#8211;&#62; but I &#8230; <a href="http://www.open-source-web.com/css/easy-css-compatability/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/css/easy-css-compatability/" data-twtext="Easy CSS compatability" data-shareurl="http://www.open-source-web.com/css/easy-css-compatability/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>For every web developer / designer the issues in earlier versions of IE can be a real pain. Even simple styling such as margins and padding can make a design look like it&#8217;s upside down.</p>
<p>The obvious hacks for CSS involve using a separate style sheet and the old school &lt;!&#8211; if IE&#8211;&gt; but I always manage to avoid these mainly because I like to keep all the CSS in one file to keep overall page size down and it&#8217;s also more easier to fix other issues when all the CSS rules are in one file.</p>
<p>IE  issues</p>
<p>The easiest way to target issues in IE6 is to use the _property hack.</p>
<p>_margin:20px;  /// this will only be used by IE 6</p>
<p>There is also a hack for IE7 which works in a similor way using the *</p>
<p>*margin:20px;  /// this will only be used by IE 7</p>
<p>Although these may cause CSS problems to validators they are still very valid fixes and I have never seen a drawback to using these.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/css/easy-css-compatability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP and dynamic URLs</title>
		<link>http://www.open-source-web.com/php/php-and-dynamic-urls/</link>
		<comments>http://www.open-source-web.com/php/php-and-dynamic-urls/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 22:09:01 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=172</guid>
		<description><![CDATA[Whenever I make a new website now I always think about what the urls will need to be like. Most off the shelf CMS platforms will have a plug in or option to enables similar functionality.  But if your writing the site yourself you will want to be able to convert URL from post Id&#8217;s &#8230; <a href="http://www.open-source-web.com/php/php-and-dynamic-urls/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/php/php-and-dynamic-urls/" data-twtext="PHP and dynamic URLs" data-shareurl="http://www.open-source-web.com/php/php-and-dynamic-urls/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>Whenever I make a new website now I always think about what the urls will need to be like. Most off the shelf CMS platforms will have a plug in or option to enables similar functionality.  But if your writing the site yourself you will want to be able to convert URL from post Id&#8217;s to post names to Urls and back again.</p>
<p>I have used many methods to do this in the past but recently I found two really useful built in PHP functions. <strong>urlencode()</strong> and <strong>urldecode()</strong>.</p>
<p>Alternatives to using <strong>urlencode() </strong>would be writing your own function to convert all the url unfriendly symbols, slashes, spaces etc. into HTML entities or just replacing them with hyphens.</p>
<p>Again PHP has an built in function for everyhting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/php/php-and-dynamic-urls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free tech ebooks, the definitive free guides</title>
		<link>http://www.open-source-web.com/web-development/free-tech-ebooks-the-definitive-free-guides/</link>
		<comments>http://www.open-source-web.com/web-development/free-tech-ebooks-the-definitive-free-guides/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 12:17:31 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=161</guid>
		<description><![CDATA[Learning new programming languages is fun but it can be difficult choosing which references and books to use. Most good text book will cost a small fortune and go out of date within a few months and probably wont cover everything you need. For me the best resource comes straight from the source, for most &#8230; <a href="http://www.open-source-web.com/web-development/free-tech-ebooks-the-definitive-free-guides/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/web-development/free-tech-ebooks-the-definitive-free-guides/" data-twtext="Free tech ebooks, the definitive free guides" data-shareurl="http://www.open-source-web.com/web-development/free-tech-ebooks-the-definitive-free-guides/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>Learning new programming languages is fun but it can be difficult choosing which references and books to use. Most good text book will cost a small fortune and go out of date within a few months and probably wont cover everything you need.</p>
<p>For me the best resource comes straight from the source, for most languages you will be able to find a FREE and complete reference to develop with.</p>
<p><a title="php free ebook" href="http://www.php.net/download-docs.php" target="_blank">PHP Documentation</a> &#8211; Download the complete reference in most spoken languages.</p>
<p><a title="msdn javascript" href="http://msdn.microsoft.com/en-us/library/72bd815a.aspx" target="_blank">MSDN Javascript</a> &#8211; Microsoft have a vast documentation library available on-line.</p>
<p><a title="mozilla javascript" href="https://developer.mozilla.org/en/JavaScript_Language_Resources" target="_blank">Mozilla Javascript Resource</a> &#8211; Not great but it goes into a lot of detail, maybe too much.</p>
<p><a title="mozilla js core 1.5" href="http://devedge-temp.mozilla.org/library/manuals/2000/javascript/1.5/reference/" target="_blank">Core Javascript 1.5 from Mozilla</a> &#8211; Learn by example, much better than the previous Mozilla link</p>
<p><a title="css v1" href="http://www.w3.org/Style/css1-updates/REC-CSS1-19990111.pdf" target="_blank">w3 CSS v1</a> &#8211; Full guide to CSS v1 from 1996 &#8211; 2009 in PDF format.</p>
<p><a title="css 2.1" href="http://www.w3.org/TR/CSS21/" target="_blank">w3 guide to css 2.1</a> &#8211; Full on-line reference to css v2.1</p>
<p><a title="html 3 guide" href="http://www.w3.org/TR/REC-html32" target="_blank">w3 HTML 3 guide</a> -  An awesome guide to HTML, very handy for SEO Tricks,</p>
<p><a title="Flash guide" href="http://livedocs.adobe.com/flash/9.0/main/flash_as3_programming.pdf" target="_blank">Action Script 3</a> &#8211; Official full guide to Action script 3 programming.</p>
<p><a title="cs3 guide" href="http://www.adobe.com/support/documentation/en/flash/" target="_blank">CS3</a> &#8211; The full CS3 shabang from Adobe, I haven&#8217;t found a decent <a title="flash wordpress" href="http://www.open-source-web.com/flash/flashactionscript-wordpress-rss-reader/" target="_self">Flash </a>book yet so this is awesome.</p>
<p><a title="mysql guide" href="http://dev.mysql.com/doc/refman/5.1/en/index.html" target="_blank">Mysql </a>- One of the less helpful guides but it is fairly complete.</p>
<p><a title="wordpress guide" href="http://codex.wordpress.org/Function_Reference" target="_blank">WordPress Functions </a>- The official function list, awesome for any wordpress project</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/web-development/free-tech-ebooks-the-definitive-free-guides/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best SEO Companies</title>
		<link>http://www.open-source-web.com/seo/best-seo-companies/</link>
		<comments>http://www.open-source-web.com/seo/best-seo-companies/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 19:42:32 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=157</guid>
		<description><![CDATA[Finding a good SEO company can be pretty difficult, most will call you and make promises they can&#8217;t keep like they will get you on the front page of Google in a week for a term nobody will search for. There are a lot of cowboys just like any industry. That&#8217;s why it&#8217;s good to &#8230; <a href="http://www.open-source-web.com/seo/best-seo-companies/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/seo/best-seo-companies/" data-twtext="Best SEO Companies" data-shareurl="http://www.open-source-web.com/seo/best-seo-companies/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>Finding a good SEO company can be pretty difficult, most will call you and make promises they can&#8217;t keep like they will get you on the front page of Google in a week for a term nobody will search for. There are a lot of cowboys just like any industry.</p>
<p>That&#8217;s why it&#8217;s good to do some research in your online marketing company.</p>
<ol>
<li>Ask to see success stories of recent clients.</li>
<li>Take a look at the work they do, make sure you can see what you are actually paying for.</li>
<li>Don&#8217;t sign up for a long term contract unless they can perform in the short term.</li>
<li>Ask what they can do that other companies can&#8217;t</li>
<li>Ask for face to face meetings and regular updates on targets</li>
</ol>
<p>Lastly make sure they have good impartial reviews. Recently topseos.com did a comprehensive list of the top SEO companies in the UK. <a title="internet marketing" href="http://theeword.co.uk">theEword</a> was ranked 9th in the top SEO companies list which is great as it proves all the hard work is paying off.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/seo/best-seo-companies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript click() method</title>
		<link>http://www.open-source-web.com/javascript/javascript-click-method/</link>
		<comments>http://www.open-source-web.com/javascript/javascript-click-method/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 14:04:44 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=148</guid>
		<description><![CDATA[Javascript has evolved into a great web programming language over the last few years with its compatibility getting much greater then it was and with the versatility of the script. This week I came back to a script I wrote some time ago using a frame work. The script basically allowed the visitor to click &#8230; <a href="http://www.open-source-web.com/javascript/javascript-click-method/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/javascript/javascript-click-method/" data-twtext="Javascript click() method" data-shareurl="http://www.open-source-web.com/javascript/javascript-click-method/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>Javascript has evolved into a great web programming language over the last few years with its compatibility getting much greater then it was and with the versatility of the script.</p>
<p>This week I came back to a script I wrote some time ago using a frame work. The script basically allowed the visitor to click next or previous and scroll through a list element. Although dynamic HTML is pretty awesome it can be hard to maintain.</p>
<p>Due to requirements the scroll er has had to be automated as well as respond to a users click which it wasn&#8217;t built for, At first it may need to be re written from scratch but then I came across the click() method.</p>
<p>Click() basically simulates a users click on a button in javascript. Unfortunately it only works with form button elements and not with elements such as hyperlinks.</p>
<p>If you need to simulate the click of another type of element I would suggest making a button and giving it the style display:none;</p>
<p>example usage</p>
<p>getElementByID(&#8216;someid&#8217;).click();</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/javascript/javascript-click-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter PHP and SimpleXML feed</title>
		<link>http://www.open-source-web.com/apis/twitter-php-and-simplexml-feed/</link>
		<comments>http://www.open-source-web.com/apis/twitter-php-and-simplexml-feed/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 20:45:04 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[API's]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[simpleXML]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=136</guid>
		<description><![CDATA[Just like the Google Charts API the Twitter API can be super simple. Twitter uses a few different XML feeds to send and receive data from a given user, some feeds require a user name and password supplied through Curl but a few are publicly available to all. This example will use the built in &#8230; <a href="http://www.open-source-web.com/apis/twitter-php-and-simplexml-feed/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/apis/twitter-php-and-simplexml-feed/" data-twtext="Twitter PHP and SimpleXML feed" data-shareurl="http://www.open-source-web.com/apis/twitter-php-and-simplexml-feed/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>Just like the <a href="http://www.open-source-web.com/php/google-charts-example/">Google Charts API</a> the Twitter API can be super simple. Twitter uses a few different XML feeds to send and receive data from a given user, some feeds require a user name and password supplied through Curl but a few are publicly available to all.</p>
<p>This example will use the built in SimpleXML functions which come with PHP5, this is a much faster and easier way to using alternative readers such as simplePie or anything else you might come across. As far as it goes I don&#8217;t think SimpleXML gets enough coverage so I am happy to put it to some use for this example.</p>
<p>Keeping it basic</p>
<p>&lt;?php</p>
<p>$xml = simplexml_load_file(&#8220;http://twitter.com/statuses/user_timeline/adi182.xml?count=2&#8243;);<br />
if($xml){<br />
echo &#8216;&lt;h3&gt;&lt;a href=&#8221;http://www.twitter.com/adi182&#8243;&gt;Latest Tweets&lt;/a&gt;&lt;/h3&gt;<br />
&lt;ul&gt;&#8217;;<br />
foreach($xml-&gt;status as $tweet){<br />
$description = $tweet-&gt;text;<br />
echo &#8216;&lt;li&gt;&#8217;.$description.&#8217;&lt;/li&gt;&#8217;;<br />
}<br />
echo &#8216; &lt;/ul&gt;&#8217;;<br />
}<br />
?&gt;</p>
<p>So there you have it, the super simple example on putting a Twiter feed on your website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/apis/twitter-php-and-simplexml-feed/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Javascript get element by id</title>
		<link>http://www.open-source-web.com/javascript/javascript-get-element-by-id/</link>
		<comments>http://www.open-source-web.com/javascript/javascript-get-element-by-id/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 21:36:16 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[getlementbyid]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=132</guid>
		<description><![CDATA[Javascript is probably the most awesome tool a web developer can use to make a website both functional and look nice. Javascript has also evolved over the years with the DOM it has become much easier to develop. One useful piece of code I always end up using when writing Javascript is getElementById, the way &#8230; <a href="http://www.open-source-web.com/javascript/javascript-get-element-by-id/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/javascript/javascript-get-element-by-id/" data-twtext="Javascript get element by id" data-shareurl="http://www.open-source-web.com/javascript/javascript-get-element-by-id/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>Javascript is probably the most awesome tool a web developer can use to make a website both functional and look nice. <strong>Javascript </strong>has also evolved over the years with the DOM it has become much easier to develop.</p>
<p>One useful piece of code I always end up using when writing Javascript is <strong>getElementById</strong>, the way Javascript evolved has given it much more compatibility with different browsers and in turn means you need less code to do more.</p>
<p><strong>getElementById</strong> allows you to modify any html element with a given ID. so for example if you have a &lt;div&gt; with the ID jstest it might look like this</p>
<p>&lt;div id=&#8221;jstest&#8221;&gt;howdy&lt;/div&gt;</p>
<p>Using <strong>document.getElementById(&#8216;jstest&#8217;)</strong> we can modify this element dynamically with javascript changing anything from its appearance or position with styling or use it within our javascript code.</p>
<p>using <strong>document.getElementById(&#8216;jstest&#8217;).innerHTML</strong> we could change or get the contents of the div.</p>
<p>Another pretty awesome use for the getElementById method would be to change the style of an element dynamically, maybe you want it to disappear when clicked or have a border when highlighted.</p>
<p>To change the background of an element we could use document.getelementById(&#8216;jstest&#8217;).style.background-color = &#8216;#dedede&#8217;  this will work with any styling you could apply to an element.</p>
<p>If you are like 90% of the old school web developers I know you probably don&#8217;t like using javascript but the modern DOM it is couldn&#8217;t be easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/javascript/javascript-get-element-by-id/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Charts Example</title>
		<link>http://www.open-source-web.com/php/google-charts-example/</link>
		<comments>http://www.open-source-web.com/php/google-charts-example/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 18:14:03 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[API's]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=117</guid>
		<description><![CDATA[API&#8217;s are becoming more popular on the web as many of the big online companies such as Google, Yahoo and Facebook offer there own open source code for web developers to use freely and easily. To begin with I am going to go through how to use the Charts Basics API from Google. This is &#8230; <a href="http://www.open-source-web.com/php/google-charts-example/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/php/google-charts-example/" data-twtext="Google Charts Example" data-shareurl="http://www.open-source-web.com/php/google-charts-example/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>API&#8217;s are becoming more popular on the web as many of the big online companies such as Google, Yahoo and Facebook offer there own open source code for web developers to use freely and easily.</p>
<p><img src="http://chart.apis.google.com/chart?chs=250x100&amp;chd=t:10,80,35,10&amp;cht=lc&amp;chl=wk1|wk2|wk3|wk4" alt="Google Charts Basics" /></p>
<p>To begin with I am going to go through how to use the Charts Basics API from Google. This is an extremely easy one to start off with as you don&#8217;t require an API key or to install anything, you don&#8217;t even need a dynamic server side script to get some nice results.</p>
<p>For this example I am going to jazz it up with a bit of PHP using an associative array but you can easily replace this with a database or XML feed.</p>
<p>To call a chart we use the query string linking to the API which will end up looking something like this.</p>
<pre id="line1">&lt;<span class="start-tag">img</span><span class="attribute-name"> src</span>=<span class="attribute-value">"http://chart.apis.google.com/chart?chs=250x100&amp;amp;chd=t:10,80,35,10&amp;amp;cht=lc&amp;amp;chl=wk1|wk2|wk3|wk4"
</span><span class="attribute-name">alt</span>=<span class="attribute-value">"Sample chart" </span><span class="error"><span class="attribute-name">/</span></span>&gt;</pre>
<p>To generate this dynamicaly I used the following code</p>
<pre class="php" name="code">$arr = array();

$arr['Jan']['wk1'] = 10;
$arr['Jan']['wk2'] = 80;
$arr['Jan']['wk3'] = 35;
$arr['Jan']['wk4'] = 10;

$chart= 'http://chart.apis.google.com/chart?';
$chartsize = 'chs=250x100';
$type = "cht=lc";
$vals = 'chd=t:';
$keys = 'chl=';
$alt = "January";

foreach( $arr['Jan'] as $key =&gt; $value){
	$vals .= $value.',';
	$keys .= $key.'|';
	}</pre>
<p>And Lastly to pull all the code together.</p>
<pre class="php" name="code">
&lt;img src="&lt;? echo $chart;?&gt;
&lt;? echo $chartsize;?&gt;
&amp;amp;&lt;? echo substr("$vals", 0, -1);?&gt;
&amp;amp;&lt;? echo $type;?&gt;
&amp;amp;&lt;? echo substr("$keys", 0, -1);?&gt;"
alt="Sample chart" /&gt;
</pre>
<p>To develop this example further use the official documentation available here <a title="Google Chart Basic" rel="nofollow" href="http://code.google.com/apis/chart/" target="_blank">Google Chart Basic</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/php/google-charts-example/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Random Banner with PHP</title>
		<link>http://www.open-source-web.com/php/random-banner-with-php/</link>
		<comments>http://www.open-source-web.com/php/random-banner-with-php/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 22:26:15 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[banners]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=103</guid>
		<description><![CDATA[This is a quick tutorial which shows how easy it is to make a random banner script with PHP. We will use a PHP array of images which is populated by a given directory and select a random index from the array to be the banner. For this example I have chosen to list the &#8230; <a href="http://www.open-source-web.com/php/random-banner-with-php/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/php/random-banner-with-php/" data-twtext="Random Banner with PHP" data-shareurl="http://www.open-source-web.com/php/random-banner-with-php/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>This is a quick tutorial which shows how easy it is to make a random banner script with PHP. We will use a PHP array of images which is populated by a given directory and select a random index from the array to be the banner.</p>
<p>For this example I have chosen to list the files from a directory as this will keep the script fairly dynamic without the need of a database. The script could be easily modified to use a database but we can come back to that later on if we need to.</p>
<p>To start off all you will need is a folder with several banners and a page to display them on.</p>
<p>$dir will be the directory you have created to grab the images from, it is important to make sure this folder only contains banners.<br />
$banners will be the array of images found in the given folder.</p>
<pre class="php" name="code">

 $banners = array();
  $dir = 'res/banners/';
  if ($handle = opendir($dir)) {
  while (false !== ($file = readdir($handle))) {
  if($file != &quot;.&quot; &amp;&amp; $file != &quot;..&quot;){
  $banners[] = $file;
  }
  }
  closedir($handle);
  }

  $rand = array_rand($banners,1);
  echo &quot;&lt;img src='&quot;.$dir.$banners[$rand].&quot;' alt='banner'/&gt;&quot;;   

</pre>
<p>The code above uses a few handy built in PHP functions:<br />
opendir()<br />
readdir()<br />
array_rand()<br />
print_r()</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/php/random-banner-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix Canonical URL with link rel=&#8221;canonical&#8221; in PHP</title>
		<link>http://www.open-source-web.com/seo/fix-canonical-url-with-link-relcanonical-in-php/</link>
		<comments>http://www.open-source-web.com/seo/fix-canonical-url-with-link-relcanonical-in-php/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 20:32:54 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[Canonical]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tag]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=83</guid>
		<description><![CDATA[Recently the major search engines have worked together to help fix one of the biggest problems in SEO, The canonical URL. With this quick fix all you need to do is add a tag to the &#60;head&#62; section of the page and search engines will use this as an anchor to index the page. since &#8230; <a href="http://www.open-source-web.com/seo/fix-canonical-url-with-link-relcanonical-in-php/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/seo/fix-canonical-url-with-link-relcanonical-in-php/" data-twtext="Fix Canonical URL with link rel=&quot;canonical&quot; in PHP" data-shareurl="http://www.open-source-web.com/seo/fix-canonical-url-with-link-relcanonical-in-php/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>Recently the major search engines have worked together to help fix one of the biggest problems in SEO, The canonical URL. With this quick fix all you need to do is add a tag to the &lt;head&gt; section of the page and search engines will use this as an anchor to index the page.</p>
<p>since it is still fairly new we don&#8217;t know how it will work in the long run and if there are any side effects such as the pagerank not transferring.</p>
<p>The new tag looks like this</p>
<p align="center"><strong><code>&lt;link rel="canonical" href="http://www.open-source-web.com/"&gt;</code></strong></p>
<p>But nothing can be that easy, obviously with a large site you wouldn&#8217;t want to write that out for a million pages so here is the PHP code to make it work.</p>
<pre name="code" class="php">

$thispage = "http://www.";
$thispage .= $_SERVER["SERVER_NAME"];
$thispage .= $_SERVER["PHP_SELF"];
if($_SERVER["QUERY_STRING"]){$thispage .= "?".$_SERVER["QUERY_STRING"];}

&lt;link rel="canonical" href="&lt;? echo $thispage;?&gt;"&gt;

</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/seo/fix-canonical-url-with-link-relcanonical-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shorthand boolean IF with PHP</title>
		<link>http://www.open-source-web.com/php/shorthand-boolean-if-with-php/</link>
		<comments>http://www.open-source-web.com/php/shorthand-boolean-if-with-php/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 19:39:22 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[quick]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=74</guid>
		<description><![CDATA[This is a good alternative to using a basic IF condition. It basically fits the whole thing on a minimal line of code. It is an  easy way to compare two values and select the right one. There are a few ways to use this but the basic jist of it is to compare two &#8230; <a href="http://www.open-source-web.com/php/shorthand-boolean-if-with-php/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/php/shorthand-boolean-if-with-php/" data-twtext="Shorthand boolean IF with PHP" data-shareurl="http://www.open-source-web.com/php/shorthand-boolean-if-with-php/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>This is a good alternative to using a basic IF condition. It basically fits the whole thing on a minimal line of code.</p>
<p>It is an  easy way to compare two values and select the right one. There are a few ways to use this but the basic jist of it is to compare two values and if its is true use the first value after the question mark, or if the condition returns false use the second value.</p>
<pre name="code" class="php">
echo $targetvar =  ($somevar == "thisVar" ? "itIsTrue" : "itIsFalse");
</pre>
<p><span style="font-size: 9pt; font-family: 'Arial','sans-serif';"><br />
In the example above we can set $targetvar with the condition. it will compare the first two variables with whatever you use, more then less then etc and it will choose the correct value from the two after the question mark.<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/php/shorthand-boolean-if-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SEO Friendly Redirects with PHP</title>
		<link>http://www.open-source-web.com/php/seo-friendly-redirects-with-php/</link>
		<comments>http://www.open-source-web.com/php/seo-friendly-redirects-with-php/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 19:32:15 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[redirect]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=60</guid>
		<description><![CDATA[With a basic redesign you probably wont have this problem but if you have rebuilt a website even with the same content if the URL&#8217;s have changed this will have a huge effect on your search engine presence as you will be starting from scratch. Your links from internal pages may not work, links from &#8230; <a href="http://www.open-source-web.com/php/seo-friendly-redirects-with-php/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/php/seo-friendly-redirects-with-php/" data-twtext="SEO Friendly Redirects with PHP" data-shareurl="http://www.open-source-web.com/php/seo-friendly-redirects-with-php/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>With a basic redesign you probably wont have this problem but if you have rebuilt a website even with the same content if the URL&#8217;s have changed this will have a huge effect on your search engine presence as you will be starting from scratch. Your links from internal pages may not work, links from external sites wont work and you will lose your pagerank (if it ever mattered anyway.)</p>
<p>A good way to keep your sites listing after a redevelopment is to use a redirect. If you are using an Apache server you can use the .htaccess file to redirect.</p>
<p><code>Redirect 301 /oldpage.html /newpage.html</code></p>
<p>But some times this isnt the best way if you have to redirect hundreds of pages. The alternative is to use a header redirect in PHP. Most web based languages such as ASP or RUBY will do the same thing but with different code.</p>
<p><code><span class="html"><br />
<span class="default">&lt;?php</span></span></code></p>
<p><code><span class="html"><span class="comment">// make this code the first line<br />
</span><span class="default">header</span><span class="keyword">(</span><span class="string">"Location: /newpage.php"</span><span class="keyword">,</span><span class="default">TRUE</span><span class="keyword">,</span><span class="default">301</span><span class="keyword">);</span><span class="keyword"> </span></span></code><code><span class="html"><span class="default"> </span><span class="comment">// 301 Moved Permanently</span></span></code> to newpage.php<br />
<code><span class="html"><span class="keyword"> </span><span class="default">?&gt;</span></span></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/php/seo-friendly-redirects-with-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Flash/Actionscript wordpress RSS reader</title>
		<link>http://www.open-source-web.com/flash/flashactionscript-wordpress-rss-reader/</link>
		<comments>http://www.open-source-web.com/flash/flashactionscript-wordpress-rss-reader/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 20:16:45 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[action script]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=53</guid>
		<description><![CDATA[I might come back and explain the code to this one in the future, but for now it is a basic example of how you can use Flash with dynamic content. Using and XML based RSS feed generated from word press we can use actionscript to import and interprete the tags into something we can &#8230; <a href="http://www.open-source-web.com/flash/flashactionscript-wordpress-rss-reader/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/flash/flashactionscript-wordpress-rss-reader/" data-twtext="Flash/Actionscript wordpress RSS reader" data-shareurl="http://www.open-source-web.com/flash/flashactionscript-wordpress-rss-reader/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>I might come back and explain the code to this one in the future, but for now it is a basic example of how you can use Flash with dynamic content. Using and XML based RSS feed generated from word press we can use actionscript to import and interprete the tags into something we can use in Flash.</p>
<p>XML is a format used throughout coding languages and especialy popular with web based technology as it is a language all others can use.</p>
</p>
<p><object width="550" height="400" data="http://www.open-source-web.com/wp-content/uploads/2009/01/rssfeed.swf" type="application/x-shockwave-flash"><param name="src" value="http://www.open-source-web.com/wp-content/uploads/2009/01/rssfeed.swf" /></object></p>
<p>I have left this example pretty basic so you can make edits without much knowledge of ActionScript, but if you have any questions leave a comment <img src='http://www.open-source-web.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre name="code" class="php">
package {
	import flash.display.*;
	import flash.events.*;
	import flash.text.*;
	import flash.net.*;
	import flash.system.*;

	public class rss extends MovieClip {

		public var xmldata:XML;  
		public var titles:Array=new Array;

		public function rss(){ //constructor
			xmlimport();
			}

		public function xmlimport() {   /// the money shot
			xmldata=new XML;   //// create new xml feed
			var xmlURL:URLRequest=new URLRequest("http://www.open-source-web.com/feed/");   // set the url to the feed
			var xmlLoader:URLLoader=new URLLoader(xmlURL);       //// go get it
			xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded);   /// on complete do something
			xmlLoader.addEventListener(IOErrorEvent.IO_ERROR,xmlLoadError);   /// else go here
		}
		public function xmlLoaded(event:Event) {   //// xml is loaded ok whahoo
			xmldata=XML(event.target.data); /// xml loaded ok
			trace("XML loaded successfully.");

			trace("first child - " + xmldata.children().length());   ///// trace the title for debug
			feedtest.text = xmldata.channel.title[0];    /// put title of feed in the box called feedtext

			var ex:int=10;  // position it
			var wi:int=100;

			for(var f:int=0; f < xmldata.channel.item.length(); f++){  // for each item int he feed process it
			trace(xmldata.channel.item[f].title);
			var titlebutton:titlebutt=new titlebutt;   //// make new product mc + add attributes
				titlebutton.x = ex;
				titlebutton.y = wi;
				titlebutton.description = xmldata.channel.item[f].description;
				titlebutton.link = xmldata.channel.item[f].link;
				titlebutton.addEventListener(MouseEvent.CLICK,clicked);   /// set for buttom mc clilcked
				titlebutton.addEventListener(MouseEvent.MOUSE_OVER,over);   //// get description on mouse over
				titlebutton.title.text = xmldata.channel.item[f].title;
				titles.push(titlebutton); /// add to array
				addChild(titlebutton);
				wi=wi+30;
			}
		}

		public function clicked(event:Event){    //// go to the article when clicked
		navigateToURL(new URLRequest(event["currentTarget"].link), "_blank");
	}

	public function over(event:Event){   //// load the description on mouse over
		descriptionbox.text = event["currentTarget"].description;
	}

		public function xmlLoadError(event:IOErrorEvent) {   /// check for error from loading xml file
			trace(event.text);
		}
	}
}

</pre>
<p><a href="http://www.open-source-web.com/wp-content/uploads/2009/01/rssreader.zip">Download the Flash rss reader</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/flash/flashactionscript-wordpress-rss-reader/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>GTA game character movement in Flash AS3</title>
		<link>http://www.open-source-web.com/flash/gta-game-character-movement-in-flash-as3/</link>
		<comments>http://www.open-source-web.com/flash/gta-game-character-movement-in-flash-as3/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 10:39:09 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[gta]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=35</guid>
		<description><![CDATA[This is going to be a quick introduction into game programming in Flash with AS3. The idea of this tutorial will be to emulate the movement the character had in the original Grand Theft Auto game on the play station and PC. Step 1:Make a new movie Open up Flash and click the create new &#8230; <a href="http://www.open-source-web.com/flash/gta-game-character-movement-in-flash-as3/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/flash/gta-game-character-movement-in-flash-as3/" data-twtext="GTA game character movement in Flash AS3" data-shareurl="http://www.open-source-web.com/flash/gta-game-character-movement-in-flash-as3/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>This is going to be a quick introduction into game programming in Flash with AS3. The idea of this tutorial will be to emulate the movement the character had in the original Grand Theft Auto game on the play station and PC.</p>
<p><object width="550" height="400" data="http://www.open-source-web.com/wp-content/uploads/2009/01/gtamovement.swf" type="application/x-shockwave-flash"><param name="src" value="http://www.open-source-web.com/wp-content/uploads/2009/01/gtamovement.swf" /></object></p>
<p>Step 1:Make a new movie</p>
<p>Open up Flash and click the create new icon on the top left. at the moment it doesn&#8217;t matter what size it is.</p>
<p><img class="alignnone size-full wp-image-37" title="gta1" src="http://www.open-source-web.com/wp-content/uploads/2009/01/1.jpg" alt="gta1" width="200" height="200" /></p>
<p>Step 2: Make your sprite</p>
<p>Look for the Library in Flash, right click the and go down to &#8220;New Symbol&#8221;. This will be our main character, I have called it &#8220;hero&#8221; for now. This is partly as I reuse Action script from game to game so having as generic name helps to import code.</p>
<p><img class="alignnone size-full wp-image-38" title="gta2" src="http://www.open-source-web.com/wp-content/uploads/2009/01/2.jpg" alt="gta2" width="400" height="400" /></p>
<p>Make sure the symbol type is set to movie clip and for Linkage select &#8220;Export for action script&#8221; as we may need this later on for further development. Then Click &#8220;OK&#8221; to create the hero sprite.</p>
<p><img class="alignnone size-full wp-image-39" title="gta3" src="http://www.open-source-web.com/wp-content/uploads/2009/01/3.jpg" alt="gta3" width="420" height="500" /></p>
<p>Step 3: Draw your sprite</p>
<p>The window will change slightly, check you are drawing on the hero movie clip.</p>
<p><img class="alignnone size-full wp-image-40" title="gta4" src="http://www.open-source-web.com/wp-content/uploads/2009/01/4.jpg" alt="gta4" width="400" height="200" /></p>
<p>Make sure you are drawing your character right on the little black cross and use the tools on the left to make a basic overhead view of our hero.</p>
<p>It doesn&#8217;t need to be anything too Flashy at the moment as we can change it later on.</p>
<p><img class="alignnone size-full wp-image-41" title="gta5" src="http://www.open-source-web.com/wp-content/uploads/2009/01/5.jpg" alt="gta5" width="400" height="200" /></p>
<p>Step 4: The ActionScript file</p>
<p>The next step will allow us to attach an external ActionScript file. you can add the code to the current Flash movie but I find it easier to keep them separate.</p>
<p>go to File &gt; New</p>
<p>Select Actionscript file from the menu and click OK. Once it has opened click File save as and save it to the same directory as your original flash movie.</p>
<p><img class="alignnone size-full wp-image-42" title="gta6" src="http://www.open-source-web.com/wp-content/uploads/2009/01/6.jpg" alt="gta6" width="650" height="430" /></p>
<p>Step 5: Attach the movie and the Actionscript file together.</p>
<p>To make Flash compile the actionscript file with the movie we need to attach the newly created file to movie. Select the Flash movie tab in Flash and look for the following box on the bottom right and enter the name of the actionscript file without the .as.</p>
<p><img class="alignnone size-full wp-image-44" title="gta8" src="http://www.open-source-web.com/wp-content/uploads/2009/01/8.jpg" alt="gta8" width="400" height="200" /></p>
<p>Step 6: On to the code</p>
<p>On to the fun bit. Select the ActionScript file tab in the Flash window. It will look differant to the Flash window as we are just writing code in this one.</p>
<p><img class="alignnone size-full wp-image-43" title="gta7" src="http://www.open-source-web.com/wp-content/uploads/2009/01/7.jpg" alt="gta7" width="400" height="300" /></p>
<p>To start the code off we need to add common actionscript packages and create the game class.</p>
<pre name="code" class="php">package {
	import flash.display.*;
	import flash.events.*;
	import flash.text.*;
	import flash.geom.*;
	import flash.net.*;
	import flash.system.*;

	public class gtamovement extends MovieClip {

	}
</pre>
<p><img class="alignnone size-full wp-image-45" title="gta9" src="http://www.open-source-web.com/wp-content/uploads/2009/01/9.jpg" alt="gta9" width="450" height="300" /></p>
<p>Step 7: Global variables<br />
Add these variables just below the class definition. The top group are to check if a key is down or up and the secont group are charactor vairables.</p>
<pre name="code" class="php">		///// key listeners vars
		public var arrowLeft:Boolean=false;
		public var arrowRight:Boolean=false;
		public var arrowUp:Boolean=false;
		public var arrowDown:Boolean=false;
		public var space:Boolean=false;

		public var Hero:hero=new hero;
		public var speed:Number = 5.5;
		public var dir:int = 0;
		public var piover180:Number = Math.PI /180;
		public var sharpness:Number =20;</pre>
<p>Step 8 : The constructor<br />
The constructor is givent the same name as the class and is then run automatically when the class is called. For this game we will set up some event listeners and add the hero to the movie.</p>
<pre name="code" class="php">public function gtamovement() {/// constructor run when program is loaded
			trace('Go!');  // test to see if we got this far.
			/////   Key Listener
			stage.addEventListener(KeyboardEvent.KEY_DOWN,keyDownFunction);
			stage.addEventListener(KeyboardEvent.KEY_UP,keyUpFunction);
			stage.addEventListener(Event.ENTER_FRAME,redrawGame);// set game loop

			Hero.x = 100;
			Hero.y = 100;
			addChild(Hero);
		}
</pre>
<p>Step 9: Movie the hero<br />
The next function if probably a bit over complicated but it works fine for what we are after. Basicaly it will only move the hero forward and backward but also reotate it to face any direction.</p>
<pre name="code" class="php">public function movehero() {////////   move hero
			if (arrowLeft) {
				Hero.rotation -= sharpness;
			} else if (arrowRight) {
				Hero.rotation += sharpness;
			} else if (arrowUp) {
				dir = 1;
			} else if (arrowDown) {
				dir = -1;
			} else {
				dir = 0;
			}
			var movex = Math.sin(Hero.rotation*piover180)*speed*dir;
			var movey = Math.cos(Hero.rotation*piover180)*speed*dir;
			Hero.x += Math.sin(Hero.rotation*piover180)*speed*dir;
			Hero.y -= Math.cos(Hero.rotation*piover180)*speed*dir;
		}</pre>
<p>Step 10: Redraw the game<br />
This function is called from the constructor and will loop as long as the game is running. if you wanted to add functionality to pause or move other sprites here is the palce to do it.</p>
<pre name="code" class="php">public function redrawGame(event:Event) {
			movehero();  // Add any other functions you may want looped here.
		}
</pre>
<p>Step 11: The key listeners</p>
<pre name="code" class="php">public function keyDownFunction(event:KeyboardEvent) {
			if (event.keyCode == 37) {
				arrowLeft=true;
			} else if (event.keyCode == 39) {
				arrowRight=true;
			} else if (event.keyCode == 38) {
				arrowUp=true;
			} else if (event.keyCode == 40) {
				arrowDown=true;
			} else if (event.keyCode == 32) {
				space=true;
			} else {
				trace(event.keyCode); // find out which other key was pressed
			}
		}
		public function keyUpFunction(event:KeyboardEvent) {
			if (event.keyCode == 37) {
				arrowLeft=false;
			} else if (event.keyCode == 39) {
				arrowRight=false;
			} else if (event.keyCode == 38) {
				arrowUp=false;
			} else if (event.keyCode == 40) {
				arrowDown=false;
			} else if (event.keyCode == 32) {
				space=false;
			}
		}
</pre>
<p><a href="http://www.open-source-web.com/wp-content/uploads/2009/01/gtamovement.zip">Download gta movement</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/flash/gta-game-character-movement-in-flash-as3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tracking visitors with PHP and Predefined variables</title>
		<link>http://www.open-source-web.com/php/tracking-visitors-with-php-and-predefined-variables/</link>
		<comments>http://www.open-source-web.com/php/tracking-visitors-with-php-and-predefined-variables/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 22:37:21 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[predefined]]></category>
		<category><![CDATA[tracking]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=29</guid>
		<description><![CDATA[Although Google analytics can tell us a lot about who is visiting our websites it is still flawed in many ways. Google analytics is a powerful tool but if the user has disabled Javascript or you want to know live stats it can be pretty useless. Developing our own can be much more versatile as &#8230; <a href="http://www.open-source-web.com/php/tracking-visitors-with-php-and-predefined-variables/" class="more-link">Continue reading <span class="meta-nav">&#187;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="lazysocialbuttons" data-float="left" data-buttons="google,twitter,facebook" data-twshareurl="http://www.open-source-web.com/php/tracking-visitors-with-php-and-predefined-variables/" data-twtext="Tracking visitors with PHP and Predefined variables" data-shareurl="http://www.open-source-web.com/php/tracking-visitors-with-php-and-predefined-variables/" data-fbhideflyout="false" data-backgroundtype="light"></div><p>Although Google analytics can tell us a lot about who is visiting our websites it is still flawed in many ways. Google analytics is a powerful tool but if the user has disabled Javascript or you want to know live stats it can be pretty useless.</p>
<p>Developing our own can be much more versatile as we can gather information straight from the server using PHP&#8217;s Predefined variables.</p>
<p>You can add your own version of with a database and a few lines of PHP code.</p>
<pre class="php" name="code">
$time = mktime();
if (isset($_SERVER['REQUEST_METHOD'])) {   // HTTP-method
   $method = $_SERVER['REQUEST_METHOD'];
} else {
   $method = "";
}
if (isset($_SERVER['REMOTE_ADDR'])) {      // IP-adress
   $ip_adress = $_SERVER['REMOTE_ADDR'];
} else {
   $ip_adress = "";
}
if (isset($_SERVER['HTTP_USER_AGENT'])) {  // Browser
   $browser = $_SERVER['HTTP_USER_AGENT'];
} else {
   $browser = "";
}
if (isset($_SERVER['PHP_SELF'])) {         // Current page
   $page = $_SERVER['PHP_SELF'];
} else {
   $page = "";
}
if (isset($_SERVER['HTTP_REFERER'])) {    // Previous page
   $referer = $_SERVER['HTTP_REFERER'];
} else {
   $referer = "";
}

$sql="INSERT INTO user_log (time, method, page, referer, adress, browser) // Insert into database as new row
					VALUES('$time','$method','$page','$referer','$ip_adress','$browser')";
mysql_query($sql);</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/php/tracking-visitors-with-php-and-predefined-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
