<?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>Cloud Testing Blog &#187; PHP</title>
	<atom:link href="http://www.cloudtesting.com/blog/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cloudtesting.com/blog</link>
	<description>Automated Functional, Cross Browser and Load Testing for Websites</description>
	<lastBuildDate>Tue, 23 Aug 2011 18:41:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PHP / Web Developer</title>
		<link>http://www.cloudtesting.com/blog/2011/07/28/php-web-developer/</link>
		<comments>http://www.cloudtesting.com/blog/2011/07/28/php-web-developer/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 10:46:30 +0000</pubDate>
		<dc:creator>Matt Rees - Cloud Testing</dc:creator>
				<category><![CDATA[Careers]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[Job]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.cloudtesting.com/blog/?p=1514</guid>
		<description><![CDATA[Role: PHP Developer Salary: To £30K depending on experience Based: Guildford, Surrey We are looking for an experienced PHP developer to join our expanding team in Guildford developing a new User eXperience (UX) product. Key skills include PHP 5, MySQL, CSS, JavaScript, jQuery Experience of web analytics and / or website performance monitoring would be [...]]]></description>
			<content:encoded><![CDATA[<h3>Role: PHP Developer</h3>
<h3>Salary: To £30K depending on experience</h3>
<h3>Based: Guildford, Surrey</h3>
<p>We are looking for an experienced PHP developer to join our expanding team in Guildford developing a new User eXperience (UX) product.</p>
<p>Key skills include PHP 5, MySQL, CSS, JavaScript, jQuery</p>
<p>Experience of web analytics and / or website performance monitoring would be an advantage but not essential.</p>
<p>Please submit your CV to CEO Phil Smith (<a href="mailto:phil@cloudtesting.com">phil@cloudtesting.com</a>)</p>
<p>We work with a select number of recruitment consultants and regret that we are unable to take enquiries from new agencies.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cloudtesting.com/blog/2011/07/28/php-web-developer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Randomising your web content</title>
		<link>http://www.cloudtesting.com/blog/2009/12/08/randomising-your-web-content/</link>
		<comments>http://www.cloudtesting.com/blog/2009/12/08/randomising-your-web-content/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 15:32:36 +0000</pubDate>
		<dc:creator>Matt Rees - Cloud Testing</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.cloudtesting.com/blog/?p=1187</guid>
		<description><![CDATA[You may want to try out various permutations of your website content and then evaluate their performance in terms of click through / conversion rates. Here is one way of doing it. To generate different (randomised) content &#8211; two versions in this case, but you can add as many as you want: PHP Code // [...]]]></description>
			<content:encoded><![CDATA[<p>You may want to try out various permutations of your website content and then evaluate their performance in terms of click through / conversion rates. Here is one way of doing it.</p>
<p>To generate different (randomised) content &#8211; two versions in this case, but you can add as many as you want:</p>
<h2>PHP Code</h2>
<pre><span style="color: #0000ff;">// get a random number in the range 0-1 (inclusive)
$pageVersion = rand(0,1);</span></pre>
<pre><span style="color: #0000ff;">// set the server side session variable</span></pre>
<pre><span style="color: #0000ff;">$_SESSION["PageVersion"] = $pageVersion;</span></pre>
<pre><span style="color: #0000ff;">if ($pageVersion == 0)
{
    $cSmarty-&gt;display('/index.tpl');
}
else
{
    $cSmarty-&gt;display('/index2.tpl');
}</span></pre>
<p>Of course you may not want to have a completely different entire page, in which case simply drop in different content into various places on the page and then set appropriate session variables to allow the tracking.</p>
<p>When the final event takes place (such as the purchase or sign-up) all you have to do is inspect the session variable to work out which route they too.</p>
<pre><span style="color: #0000ff;">echo $_SESSION["PageVersion"];</span></pre>
<p>The above is all possible via your AdWords account, but there are times when it&#8217;s better to do your own thing and not let Google know everything about you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cloudtesting.com/blog/2009/12/08/randomising-your-web-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serving different content to your visitors by country</title>
		<link>http://www.cloudtesting.com/blog/2009/12/08/serving-different-content-to-your-visitors-by-country/</link>
		<comments>http://www.cloudtesting.com/blog/2009/12/08/serving-different-content-to-your-visitors-by-country/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 13:37:57 +0000</pubDate>
		<dc:creator>Matt Rees - Cloud Testing</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ip blocking]]></category>

		<guid isPermaLink="false">http://www.cloudtesting.com/blog/?p=1179</guid>
		<description><![CDATA[Here at Cloud Testing, we decided to start serving different content to different visitors depending on where in the world they come from. &#8220;Why would you want to do that ?&#8221; you might ask, well we use it to offer special offers to customers in markets or countries we&#8217;re targeting. You might also not be [...]]]></description>
			<content:encoded><![CDATA[<p>Here at Cloud Testing, we decided to start serving different content to different visitors depending on where in the world they come from.</p>
<p>&#8220;Why would you want to do that ?&#8221; you might ask, well we use it to offer special offers to customers in markets or countries we&#8217;re targeting. You might also not be interested or able to provide your service in a country.</p>
<p>It&#8217;s all done  server side based on the IP that they come from, and makes use of the service from IP Info DB &#8211; <a href="http://www.ipinfodb.com/">http://www.ipinfodb.com/</a></p>
<p>In PHP you can get the country of the visitor using the following code (for PHP5):</p>
<pre><span style="color: #0000ff;">function visitorCountry() {

    $ip = getenv('REMOTE_ADDR');
    $d = file_get_contents(
        "http://www.ipinfodb.com/ip_query_country.php?ip=$ip&amp;output=xml");

    //Use backup server if cannot make a connection
    if (!$d) {
        $backup = file_get_contents(
            "http://backup.ipinfodb.com/ip_query.php?ip=$ip&amp;output=xml");

        $answer = new SimpleXMLElement($backup);

        if (!$backup)
            return false; // Failed to open connection

    } else {
        $answer = new SimpleXMLElement($d);
    }
    return $answer-&gt;CountryCode;
}</span></pre>
<p>Once you have this, you can re-direct visitors to specific pages (in this case US customers).</p>
<pre><span style="color: #0000ff;">$sCountryFrom = visitorCountry();
if ( $sCountryFrom == 'US' )
{
    header('Location: /special_offer_us.php');
    exit(0);
}</span></pre>
<p>or customize content on a page, change prices dynamically, serve language specific content (in the following example using Smarty).</p>
<pre><span style="color: #0000ff;">if ( $sCountryFrom == 'DE' )
{
    // serve German content template if they are from Germany
</span>
<pre><span style="color: #0000ff;">    $cSmarty-&gt;display('/index_de.tpl');
}</span>
<span style="color: #0000ff;">else
{
    // serve English to everyone else
    $cSmarty-&gt;display('/index.tpl');
}</span></pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.cloudtesting.com/blog/2009/12/08/serving-different-content-to-your-visitors-by-country/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

