<?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>Web Development</title>
	<atom:link href="http://www.uk-webdeveloper.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.uk-webdeveloper.co.uk</link>
	<description>Web development tips, tricks and snippets</description>
	<lastBuildDate>Mon, 31 Oct 2011 10:02:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Detect Locale with javascript</title>
		<link>http://www.uk-webdeveloper.co.uk/detect-locale-with-javascript/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=detect-locale-with-javascript</link>
		<comments>http://www.uk-webdeveloper.co.uk/detect-locale-with-javascript/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 09:37:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[language detection]]></category>
		<category><![CDATA[multi-lingual]]></category>

		<guid isPermaLink="false">http://www.uk-webdeveloper.co.uk/?p=94</guid>
		<description><![CDATA[There may be times where you would want to detect the language of the users browser. I would normally use php to detect the users browser language. However, when this is not possible, it can also be done using the following javascript: thelocale = 'en-GB'; // set default locale if ( navigator ) { if [...]]]></description>
			<content:encoded><![CDATA[<p><img style="float: right; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 1em;" title="Language detection" src="http://t3.gstatic.com/images?q=tbn:ANd9GcRub41Sjk41YjtKVi2BHS2jQINV1X9r5zEjvj5A_pCzZRfZGs1OiKfuR4aLzQ" alt="Language detection" width="116" height="108" />There may be times where you would want to detect the language of the users browser. I would normally <a title="PHP Language Detection" href="http://www.uk-webdeveloper.co.uk/php-language-detection/">use php to detect the users browser language</a>. However, when this is not possible, it can also be done using the following javascript:</p>
<pre><code> thelocale = 'en-GB'; // set default locale
if ( navigator ) { if ( navigator.language ) {// for netscape thelocale = navigator.language; } else if ( navigator.browserLanguage ) {// internet explorer 5.5 or above</code>
        thelocale = navigator.browserLanguage;
    }
    else if ( navigator.systemLanguage ) {// windows specific
        thelocale = navigator.systemLanguage;
    }
    else if ( navigator.userLanguage ) {
        thelocale = navigator.userLanguage;
    }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.uk-webdeveloper.co.uk/detect-locale-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Language Detection</title>
		<link>http://www.uk-webdeveloper.co.uk/php-language-detection/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=php-language-detection</link>
		<comments>http://www.uk-webdeveloper.co.uk/php-language-detection/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 02:56:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[language detection]]></category>
		<category><![CDATA[multi-lingual]]></category>

		<guid isPermaLink="false">http://www.uk-webdeveloper.co.uk/?p=83</guid>
		<description><![CDATA[There is a very simple method to detect what language the users web browser is using. The following code: //session variable ensures it's available //throughout current session $_SESSION['lang'] = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); echo $_SESSION['lang']; Will give you the correct two letter ISO code for the language the browser is using.]]></description>
			<content:encoded><![CDATA[<p>There is a very simple method to detect what language the users web browser is using.</p>
<p>The following code:</p>
<div style="width: 70%; float: left;">
<p> <code style="color: #000080; font-size: 10px"><br />
  //session variable ensures it's available<br />
  //throughout current session </p>
<p>  $_SESSION['lang'] = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);<br />
  echo $_SESSION['lang'];<br />
 </code></p>
</div>
<div style="width: 29%; float: left;">
<img style="float: right;" title="Multi lingual" src="http://coolscriptz.net/images/multilingual_690x450.png" alt="Multilingual" width="207" height="135" />
</div>
<div style="clear: both">
Will give you the correct two letter <a title="ISO Language codes" href="http://www.uk-webdeveloper.co.uk/language-codes">ISO code</a> for the language the browser is using.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.uk-webdeveloper.co.uk/php-language-detection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ISO Language codes</title>
		<link>http://www.uk-webdeveloper.co.uk/language-codes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=language-codes</link>
		<comments>http://www.uk-webdeveloper.co.uk/language-codes/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 02:51:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[international]]></category>
		<category><![CDATA[iso]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[multi-lingual]]></category>

		<guid isPermaLink="false">http://www.uk-webdeveloper.co.uk/?p=84</guid>
		<description><![CDATA[The ISO language code can be used to declare the language of a Web page (or a portion of a Web page) or identify the default browser language. Language ISO Code Abkhazian ab Afar aa Afrikaans af Albanian sq Amharic am Arabic ar Aragonese an Armenian hy Assamese as Aymara ay Azerbaijani az Bashkir ba [...]]]></description>
			<content:encoded><![CDATA[<p>The ISO language code can be used to declare the language of a Web page (or a portion of a Web page) or identify the default browser language.</p>
<table>
<tbody>
<tr>
<th align="left">Language</th>
<th align="left">ISO Code</th>
</tr>
<tr>
<td>Abkhazian</td>
<td>ab</td>
</tr>
<tr>
<td>Afar</td>
<td>aa</td>
</tr>
<tr>
<td>Afrikaans</td>
<td>af</td>
</tr>
<tr>
<td>Albanian</td>
<td>sq</td>
</tr>
<tr>
<td>Amharic</td>
<td>am</td>
</tr>
<tr>
<td>Arabic</td>
<td>ar</td>
</tr>
<tr>
<td>Aragonese</td>
<td>an</td>
</tr>
<tr>
<td>Armenian</td>
<td>hy</td>
</tr>
<tr>
<td>Assamese</td>
<td>as</td>
</tr>
<tr>
<td>Aymara</td>
<td>ay</td>
</tr>
<tr>
<td>Azerbaijani</td>
<td>az</td>
</tr>
<tr>
<td>Bashkir</td>
<td>ba</td>
</tr>
<tr>
<td>Basque</td>
<td>eu</td>
</tr>
<tr>
<td>Bengali (Bangla)</td>
<td>bn</td>
</tr>
<tr>
<td>Bhutani</td>
<td>dz</td>
</tr>
<tr>
<td>Bihari</td>
<td>bh</td>
</tr>
<tr>
<td>Bislama</td>
<td>bi</td>
</tr>
<tr>
<td>Breton</td>
<td>br</td>
</tr>
<tr>
<td>Bulgarian</td>
<td>bg</td>
</tr>
<tr>
<td>Burmese</td>
<td>my</td>
</tr>
<tr>
<td>Byelorussian (Belarusian)</td>
<td>be</td>
</tr>
<tr>
<td>Cambodian</td>
<td>km</td>
</tr>
<tr>
<td>Catalan</td>
<td>ca</td>
</tr>
<tr>
<td>Cherokee</td>
<td></td>
</tr>
<tr>
<td>Chewa</td>
<td></td>
</tr>
<tr>
<td>Chinese (Simplified)</td>
<td>zh</td>
</tr>
<tr>
<td>Chinese (Traditional)</td>
<td>zh</td>
</tr>
<tr>
<td>Corsican</td>
<td>co</td>
</tr>
<tr>
<td>Croatian</td>
<td>hr</td>
</tr>
<tr>
<td>Czech</td>
<td>cs</td>
</tr>
<tr>
<td>Danish</td>
<td>da</td>
</tr>
<tr>
<td>Divehi</td>
<td></td>
</tr>
<tr>
<td>Dutch</td>
<td>nl</td>
</tr>
<tr>
<td>Edo</td>
<td></td>
</tr>
<tr>
<td>English</td>
<td>en</td>
</tr>
<tr>
<td>Esperanto</td>
<td>eo</td>
</tr>
<tr>
<td>Estonian</td>
<td>et</td>
</tr>
<tr>
<td>Faeroese</td>
<td>fo</td>
</tr>
<tr>
<td>Farsi</td>
<td>fa</td>
</tr>
<tr>
<td>Fiji</td>
<td>fj</td>
</tr>
<tr>
<td>Finnish</td>
<td>fi</td>
</tr>
<tr>
<td>Flemish</td>
<td></td>
</tr>
<tr>
<td>French</td>
<td>fr</td>
</tr>
<tr>
<td>Frisian</td>
<td>fy</td>
</tr>
<tr>
<td>Fulfulde</td>
<td></td>
</tr>
<tr>
<td>Galician</td>
<td>gl</td>
</tr>
<tr>
<td>Gaelic (Scottish)</td>
<td>gd</td>
</tr>
<tr>
<td>Gaelic (Manx)</td>
<td>gv</td>
</tr>
<tr>
<td>Georgian</td>
<td>ka</td>
</tr>
<tr>
<td>German</td>
<td>de</td>
</tr>
<tr>
<td>Greek</td>
<td>el</td>
</tr>
<tr>
<td>Greenlandic</td>
<td>kl</td>
</tr>
<tr>
<td>Guarani</td>
<td>gn</td>
</tr>
<tr>
<td>Gujarati</td>
<td>gu</td>
</tr>
<tr>
<td>Haitian Creole</td>
<td>ht</td>
</tr>
<tr>
<td>Hausa</td>
<td>ha</td>
</tr>
<tr>
<td>Hawaiian</td>
<td></td>
</tr>
<tr>
<td>Hebrew</td>
<td>he, iw</td>
</tr>
<tr>
<td>Hindi</td>
<td>hi</td>
</tr>
<tr>
<td>Hungarian</td>
<td>hu</td>
</tr>
<tr>
<td>Ibibio</td>
<td></td>
</tr>
<tr>
<td>Icelandic</td>
<td>is</td>
</tr>
<tr>
<td>Ido</td>
<td>io</td>
</tr>
<tr>
<td>Igbo</td>
<td></td>
</tr>
<tr>
<td>Indonesian</td>
<td>id, in</td>
</tr>
<tr>
<td>Interlingua</td>
<td>ia</td>
</tr>
<tr>
<td>Interlingue</td>
<td>ie</td>
</tr>
<tr>
<td>Inuktitut</td>
<td>iu</td>
</tr>
<tr>
<td>Inupiak</td>
<td>ik</td>
</tr>
<tr>
<td>Irish</td>
<td>ga</td>
</tr>
<tr>
<td>Italian</td>
<td>it</td>
</tr>
<tr>
<td>Japanese</td>
<td>ja</td>
</tr>
<tr>
<td>Javanese</td>
<td>jv</td>
</tr>
<tr>
<td>Kannada</td>
<td>kn</td>
</tr>
<tr>
<td>Kanuri</td>
<td></td>
</tr>
<tr>
<td>Kashmiri</td>
<td>ks</td>
</tr>
<tr>
<td>Kazakh</td>
<td>kk</td>
</tr>
<tr>
<td>Kinyarwanda (Ruanda)</td>
<td>rw</td>
</tr>
<tr>
<td>Kirghiz</td>
<td>ky</td>
</tr>
<tr>
<td>Kirundi (Rundi)</td>
<td>rn</td>
</tr>
<tr>
<td>Konkani</td>
<td></td>
</tr>
<tr>
<td>Korean</td>
<td>ko</td>
</tr>
<tr>
<td>Kurdish</td>
<td>ku</td>
</tr>
<tr>
<td>Laothian</td>
<td>lo</td>
</tr>
<tr>
<td>Latin</td>
<td>la</td>
</tr>
<tr>
<td>Latvian (Lettish)</td>
<td>lv</td>
</tr>
<tr>
<td>Limburgish ( Limburger)</td>
<td>li</td>
</tr>
<tr>
<td>Lingala</td>
<td>ln</td>
</tr>
<tr>
<td>Lithuanian</td>
<td>lt</td>
</tr>
<tr>
<td>Macedonian</td>
<td>mk</td>
</tr>
<tr>
<td>Malagasy</td>
<td>mg</td>
</tr>
<tr>
<td>Malay</td>
<td>ms</td>
</tr>
<tr>
<td>Malayalam</td>
<td>ml</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>Maltese</td>
<td>mt</td>
</tr>
<tr>
<td>Maori</td>
<td>mi</td>
</tr>
<tr>
<td>Marathi</td>
<td>mr</td>
</tr>
<tr>
<td>Moldavian</td>
<td>mo</td>
</tr>
<tr>
<td>Mongolian</td>
<td>mn</td>
</tr>
<tr>
<td>Nauru</td>
<td>na</td>
</tr>
<tr>
<td>Nepali</td>
<td>ne</td>
</tr>
<tr>
<td>Norwegian</td>
<td>no</td>
</tr>
<tr>
<td>Occitan</td>
<td>oc</td>
</tr>
<tr>
<td>Oriya</td>
<td>or</td>
</tr>
<tr>
<td>Oromo (Afan, Galla)</td>
<td>om</td>
</tr>
<tr>
<td>Papiamentu</td>
<td></td>
</tr>
<tr>
<td>Pashto (Pushto)</td>
<td>ps</td>
</tr>
<tr>
<td>Polish</td>
<td>pl</td>
</tr>
<tr>
<td>Portuguese</td>
<td>pt</td>
</tr>
<tr>
<td>Punjabi</td>
<td>pa</td>
</tr>
<tr>
<td>Quechua</td>
<td>qu</td>
</tr>
<tr>
<td>Rhaeto-Romance</td>
<td>rm</td>
</tr>
<tr>
<td>Romanian</td>
<td>ro</td>
</tr>
<tr>
<td>Russian</td>
<td>ru</td>
</tr>
<tr>
<td>Sami (Lappish)</td>
<td></td>
</tr>
<tr>
<td>Samoan</td>
<td>sm</td>
</tr>
<tr>
<td>Sangro</td>
<td>sg</td>
</tr>
<tr>
<td>Sanskrit</td>
<td>sa</td>
</tr>
<tr>
<td>Serbian</td>
<td>sr</td>
</tr>
<tr>
<td>Serbo-Croatian</td>
<td>sh</td>
</tr>
<tr>
<td>Sesotho</td>
<td>st</td>
</tr>
<tr>
<td>Setswana</td>
<td>tn</td>
</tr>
<tr>
<td>Shona</td>
<td>sn</td>
</tr>
<tr>
<td>Sichuan Yi</td>
<td>ii</td>
</tr>
<tr>
<td>Sindhi</td>
<td>sd</td>
</tr>
<tr>
<td>Sinhalese</td>
<td>si</td>
</tr>
<tr>
<td>Siswati</td>
<td>ss</td>
</tr>
<tr>
<td>Slovak</td>
<td>sk</td>
</tr>
<tr>
<td>Slovenian</td>
<td>sl</td>
</tr>
<tr>
<td>Somali</td>
<td>so</td>
</tr>
<tr>
<td>Spanish</td>
<td>es</td>
</tr>
<tr>
<td>Sundanese</td>
<td>su</td>
</tr>
<tr>
<td>Swahili (Kiswahili)</td>
<td>sw</td>
</tr>
<tr>
<td>Swedish</td>
<td>sv</td>
</tr>
<tr>
<td>Syriac</td>
<td></td>
</tr>
<tr>
<td>Tagalog</td>
<td>tl</td>
</tr>
<tr>
<td>Tajik</td>
<td>tg</td>
</tr>
<tr>
<td>Tamazight</td>
<td></td>
</tr>
<tr>
<td>Tamil</td>
<td>ta</td>
</tr>
<tr>
<td>Tatar</td>
<td>tt</td>
</tr>
<tr>
<td>Telugu</td>
<td>te</td>
</tr>
<tr>
<td>Thai</td>
<td>th</td>
</tr>
<tr>
<td>Tibetan</td>
<td>bo</td>
</tr>
<tr>
<td>Tigrinya</td>
<td>ti</td>
</tr>
<tr>
<td>Tonga</td>
<td>to</td>
</tr>
<tr>
<td>Tsonga</td>
<td>ts</td>
</tr>
<tr>
<td>Turkish</td>
<td>tr</td>
</tr>
<tr>
<td>Turkmen</td>
<td>tk</td>
</tr>
<tr>
<td>Twi</td>
<td>tw</td>
</tr>
<tr>
<td>Uighur</td>
<td>ug</td>
</tr>
<tr>
<td>Ukrainian</td>
<td>uk</td>
</tr>
<tr>
<td>Urdu</td>
<td>ur</td>
</tr>
<tr>
<td>Uzbek</td>
<td>uz</td>
</tr>
<tr>
<td>Venda</td>
<td></td>
</tr>
<tr>
<td>Vietnamese</td>
<td>vi</td>
</tr>
<tr>
<td>Volapük</td>
<td>vo</td>
</tr>
<tr>
<td>Wallon</td>
<td>wa</td>
</tr>
<tr>
<td>Welsh</td>
<td>cy</td>
</tr>
<tr>
<td>Wolof</td>
<td>wo</td>
</tr>
<tr>
<td>Xhosa</td>
<td>xh</td>
</tr>
<tr>
<td>Yi</td>
<td></td>
</tr>
<tr>
<td>Yiddish</td>
<td>yi, ji</td>
</tr>
<tr>
<td>Yoruba</td>
<td>yo</td>
</tr>
<tr>
<td>Zulu</td>
<td>zu</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.uk-webdeveloper.co.uk/language-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hiding content &#8211; accessibility consideration</title>
		<link>http://www.uk-webdeveloper.co.uk/hiding-content-accessibility-consideration/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hiding-content-accessibility-consideration</link>
		<comments>http://www.uk-webdeveloper.co.uk/hiding-content-accessibility-consideration/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 19:56:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[accessibility]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Hide Content]]></category>

		<guid isPermaLink="false">http://www.uk-webdeveloper.co.uk/?p=60</guid>
		<description><![CDATA[If you need to hide content but still want it available to screen readers, avoid using  display:none in your CSS. display:none means exactly what it says &#8211; NONE! Thus the element will also be hidden from all screen readers and all browsers. To have the element hidden from browsers, but still available to screen readers [...]]]></description>
			<content:encoded><![CDATA[<p><!--Hiding content - accessibility consideration--><br />
If you need to hide content but still want it available to screen readers, avoid using  <code>display:none</code> in your CSS. <code>display:none</code> means exactly what it says &#8211; NONE! Thus the element will also be hidden from all screen readers and all browsers.</p>
<p>To have the element hidden from browsers, but still available to screen readers use techniques such as<br />
<!--Hiding content - accessibility consideration--><br />
<code>position: absolute;<br />
left: -9999px;<br />
</code>or<code><br />
text-indent: -9999px;<br />
</code><!--Hiding content - accessibility consideration-->More methods can be found here: <a title="Hiding Content for Accessibility - Snook.ca" href="http://snook.ca/archives/html_and_css/hiding-content-for-accessibility">Hiding Content for Accessibility</a>.</p>
<p>If you are hiding content temporarily, it&#8217;s most likely that you will be using jQuery to make it visible. This also means that to users who do not have Javascript enabled browsers, the element will always be hidden.</p>
<p>This can be dealt with by using jQuery to hide the element on page load, instead of using the CSS methods. Therefore, if the browser does not have javascript enabled, the element will always be visible.<br />
<!--Hiding content - accessibility consideration--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.uk-webdeveloper.co.uk/hiding-content-accessibility-consideration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copy file from remote server</title>
		<link>http://www.uk-webdeveloper.co.uk/copy-file-from-remote-server/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=copy-file-from-remote-server</link>
		<comments>http://www.uk-webdeveloper.co.uk/copy-file-from-remote-server/#comments</comments>
		<pubDate>Sat, 20 Aug 2011 02:07:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[file_get_contents]]></category>

		<guid isPermaLink="false">http://www.uk-webdeveloper.co.uk/?p=63</guid>
		<description><![CDATA[Use this script to copy a file from a remote server and save on your own server. &#60;?php $feed = "http://www.domain.com/thefile.pdf";// url to original $copydir = "/home/webdev/public_html/copies/"; //directory to copy to (CHMOD 777) $data = file_get_contents($feed); $file = fopen($copydir . "thefile.pdf", "w+"); fputs($file, $data); fclose($file); ?>]]></description>
			<content:encoded><![CDATA[<p>Use this script to copy a file from a remote server and save on your own server.</p>
<p><!--copy a file from a remote server--><br />
<code><br />
&lt;?php<br />
$feed = "http://www.domain.com/thefile.pdf";// url to original </p>
<p>$copydir = "/home/webdev/public_html/copies/"; //directory to copy to (CHMOD 777)</p>
<p>$data = file_get_contents($feed);</p>
<p>$file = fopen($copydir . "thefile.pdf", "w+");</p>
<p>fputs($file, $data);</p>
<p>fclose($file);</p>
<p>?><br />
</code><!--copy a file from a remote server--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.uk-webdeveloper.co.uk/copy-file-from-remote-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use php in .xml files</title>
		<link>http://www.uk-webdeveloper.co.uk/use-php-in-xml-files/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=use-php-in-xml-files</link>
		<comments>http://www.uk-webdeveloper.co.uk/use-php-in-xml-files/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 19:18:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.uk-webdeveloper.co.uk/?p=36</guid>
		<description><![CDATA[Using PHP and MySQL in XML sitemaps is quite easy. The first step is to use the AddType directive. The second step is to add the following code to the top of your .xml file: &#60;?php session_start(); unset($_SESSION['aErrors']); header('Content-type: text/xml'); echo '&#60;?xml version="1.0" encoding="UTF-8" ?&#62;'; ?&#62;]]></description>
			<content:encoded><![CDATA[<p><!-- Use php in .xml files --><br />
<img class="alignright size-full wp-image-57" title="xml with PHP" src="http://www.uk-webdeveloper.co.uk/wp-content/uploads/2011/08/xml1.jpg" alt="XML with PHP" width="230" height="230" /><br />
Using PHP and MySQL in XML sitemaps is quite easy.</p>
<p>The first step is to use the <a title="AddType Directive" href="addtype-directive">AddType directive</a>.</p>
<p>The second step is to add the following code to the top of your .xml file:</p>
<p><code>&lt;?php<br />
</code><code>session_start();<br />
unset($_SESSION['aErrors']);<br />
header('Content-type: text/xml');<br />
echo '&lt;?xml version="1.0" encoding="UTF-8" ?&gt;';<br />
</code><code>?&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.uk-webdeveloper.co.uk/use-php-in-xml-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AddType Directive</title>
		<link>http://www.uk-webdeveloper.co.uk/addtype-directive/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=addtype-directive</link>
		<comments>http://www.uk-webdeveloper.co.uk/addtype-directive/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 21:47:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[htaccess]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[addtype]]></category>

		<guid isPermaLink="false">http://www.uk-webdeveloper.co.uk/?p=33</guid>
		<description><![CDATA[The AddType directive is added to the .htaccess file in the directory, to modify the default mimetypes of the files you wish to be effected. A common use of the AddType directive is if you wish to use PHP in .xml files for dynamic xml sitemaps or .html files. The syntax is quite simple: AddType [...]]]></description>
			<content:encoded><![CDATA[<p><!-- AddType Directive --><br />
The AddType directive is added to the .htaccess file in the directory, to modify the default mimetypes of the files you wish to be effected.</p>
<p>A common use of the AddType directive is if you wish to use <a href="http://www.uk-webdeveloper.co.uk/use-php-in-xml-files">PHP in .xml files</a> for dynamic xml sitemaps or .html files.</p>
<p>The syntax is quite simple:</p>
<p><code>AddType mime-type file-extension</code></p>
<p>So, if we wish to include PHP in our .html file, we add the following to the .htaccess file:</p>
<p><code>AddType application/x-httpd-php .xml</code><br />
<code>AddType application/x-httpd-php .html</code></p>
<p>If using PHP version 5.x you may also wish to try:</p>
<p><code>AddType application/x-httpd-php5 .html</code><br />
<code>AddType application/x-httpd-php5 .xml</code><br />
<!-- AddType Directive --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.uk-webdeveloper.co.uk/addtype-directive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Force compatibility viewer</title>
		<link>http://www.uk-webdeveloper.co.uk/force-compatibility-viewer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=force-compatibility-viewer</link>
		<comments>http://www.uk-webdeveloper.co.uk/force-compatibility-viewer/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 06:43:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.uk-webdeveloper.co.uk/?p=15</guid>
		<description><![CDATA[A few months ago I created a large CMS website for a client using HTML5 plenty of jQuery. I thought it looked great. However, she informed me that it wasn&#8217;t rendering properly. It looked fine to me. She was using the latest version of IE, IE9 &#8211; I wasn&#8217;t. The answer was simple, force the [...]]]></description>
			<content:encoded><![CDATA[<p><!-- compatibility viewer --></p>
<p>A few months ago I created a large CMS website for a client using HTML5 plenty of jQuery. I thought it looked great. However, she informed me that it wasn&#8217;t rendering properly. It looked fine to me. She was using the latest version of IE, IE9 &#8211; I wasn&#8217;t. The answer was simple, force the compatibility view on IE9 to render as IE8. Just add this to yoursection:</p>
<p><code>&lt;meta http-equiv="X-UA-Compatible" content="IE=8"&gt;</code><br />
<!-- compatibility viewer --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.uk-webdeveloper.co.uk/force-compatibility-viewer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP/MySQL connection script</title>
		<link>http://www.uk-webdeveloper.co.uk/phpmysql-connection-script/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=phpmysql-connection-script</link>
		<comments>http://www.uk-webdeveloper.co.uk/phpmysql-connection-script/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 06:26:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[connection script]]></category>

		<guid isPermaLink="false">http://www.uk-webdeveloper.co.uk/?p=9</guid>
		<description><![CDATA[Many of us use more than one server during the entire project lifecycle. To ensure that you are able to connect to the various versions of the mysql database on each server, use this php connection script: &#60;?php $host = $_SERVER['HTTP_HOST']; // which server is it running on switch ($host) { case &#8216;localhost&#8217;: $server=&#8221;localhost&#8221;; $user=&#8221;root&#8221;; [...]]]></description>
			<content:encoded><![CDATA[<p>Many of us use more than one server during the entire project lifecycle. To ensure that you are able to connect to the various versions of the mysql database on each server, use this php connection script:<br />
<!--PHP/MySQL connection script--><br />
&lt;?php</p>
<p>$host = $_SERVER['HTTP_HOST']; // which server is it running on</p>
<p>switch ($host)<br />
{<br />
case &#8216;localhost&#8217;:<br />
$server=&#8221;localhost&#8221;;<br />
$user=&#8221;root&#8221;;<br />
$db=&#8221;database;<br />
$password=&#8221;";<br />
break;</p>
<p>case &#8216;www.webaddress.com&#8217;:<br />
$server=&#8221;mysqlserver&#8221;;<br />
$user=&#8221;username&#8221;;<br />
$db=&#8221;database&#8221;;<br />
$password=&#8221;password&#8221;;<br />
break;</p>
<p>case &#8216;www.address2.com&#8217;:<br />
$server=&#8221;mysqlserver2&#8243;;<br />
$user=&#8221;username&#8221;;<br />
$db=&#8221;database&#8221;;<br />
$password=&#8221;password&#8221;;<br />
break;</p>
<p>default:<br />
$server=&#8221;";<br />
$user=&#8221;";<br />
$db=&#8221;";<br />
$password=&#8221;";<br />
}</p>
<p>$link = mysql_connect($server, $user, $password);<br />
if (!$link) {<br />
die(&#8216;Could not connect: &#8216; . mysql_error());<br />
}</p>
<p>$selected = mysql_select_db($db,$link)<br />
or die(&#8220;Could not select database&lt;br/&gt;&lt;br/&gt;&#8221; . mysql_error());</p>
<p>?&gt;<br />
<!--PHP/MySQL connection script--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.uk-webdeveloper.co.uk/phpmysql-connection-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

