<?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>MaggsWeb:7 &#187; HTML</title>
	<atom:link href="http://www.maggsweb.com/category/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maggsweb.com</link>
	<description>www.maggsweb.com</description>
	<lastBuildDate>Fri, 03 Feb 2012 22:50:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>prevent caching of files</title>
		<link>http://www.maggsweb.com/php/prevent-caching-of-files/</link>
		<comments>http://www.maggsweb.com/php/prevent-caching-of-files/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 09:59:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[cache]]></category>

		<guid isPermaLink="false">http://www.maggsweb.com/?p=1259</guid>
		<description><![CDATA[Version them in their with their timestamp. This way, when they change, the link will change and the browser will reload the sitemap&#8230; Otherwise it will be fine to be cached as it wont have changed. ?View Code HTML&#160; &#60;link type='text/css' src='/styles/styles.css?v=&#60;?=filemtime(DOC_ROOT.&#34;/styles_ie.css&#34;)?&#62;' /&#62;]]></description>
			<content:encoded><![CDATA[<p>Version them in their
<link> with their timestamp.  This way, when they change, the link will change and the browser will reload the sitemap&#8230;   Otherwise it will be fine to be cached as it wont have changed.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1259code2'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p12592"><td class="code" id="p1259code2"><pre class="html" style="font-family:monospace;">&nbsp;
&lt;link type='text/css' src='/styles/styles.css?v=&lt;?=filemtime(DOC_ROOT.&quot;/styles_ie.css&quot;)?&gt;' /&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/php/prevent-caching-of-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>URL rewriting &#8211; WordPress style</title>
		<link>http://www.maggsweb.com/html/url-rewriting-wordpress-style/</link>
		<comments>http://www.maggsweb.com/html/url-rewriting-wordpress-style/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 13:17:40 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.maggsweb.com/?p=480</guid>
		<description><![CDATA[Add this into your .htaccess file&#8230; ?View Code APACHERewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 The first RewriteCond checks if the requested URL exists as a file on the filesystem. In mod_rewrite, -f refers to a file, while the bang is the &#8220;not&#8221; operator. Therefore, !-f means &#8220;if the request script [...]]]></description>
			<content:encoded><![CDATA[<p>Add this into your .htaccess file&#8230;</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p480code4'); return false;">View Code</a> APACHE</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4804"><td class="code" id="p480code4"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">RewriteEngine</span> <span style="color: #0000ff;">On</span>
<span style="color: #00007f;">RewriteCond</span> %{SCRIPT_FILENAME} !-f
<span style="color: #00007f;">RewriteCond</span> %{SCRIPT_FILENAME} !-d
<span style="color: #00007f;">RewriteRule</span> ^(.*)$ index.php/$<span style="color: #ff0000;">1</span></pre></td></tr></table></div>

<p><span id="more-480"></span><br />
The first <b>RewriteCond</b> checks if the requested URL exists as a file on the filesystem. In <b>mod_rewrite</b>, <b>-f</b> refers to a file, while the bang is the &#8220;not&#8221; operator. Therefore, <b>!-f</b> means &#8220;if the request script filename does not exist as a file&#8221;.</p>
<p>If the first <b>rewrite_cond</b> succeeds (that is, the requested file wasn&#8217;t found), then Apache moves on to the next condition. The <b>!-d</b> directive means it the condition succeeds if the requested script does correspond to an existing directory on the server.</p>
<p>Finally, if both conditions succeed, the request is forwarded to the <b>index.php</b> file, as specified in the <b>RewriteRule</b> directive.</p>
<p>You can now access request POST data.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/html/url-rewriting-wordpress-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>English Ordinals for dates in PHP</title>
		<link>http://www.maggsweb.com/php/english_ordinals_for_dates/</link>
		<comments>http://www.maggsweb.com/php/english_ordinals_for_dates/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 08:07:20 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[function]]></category>

		<guid isPermaLink="false">http://www.maggsweb.com/?p=396</guid>
		<description><![CDATA[Displaying the day-part of the date, followed by the month etc. just looks plain wrong and lazy &#8211; &#8217;20 September 2009&#8242;. &#8217;20th&#8217; would look much nicer and can be achieved without too much hard work. A simple function&#8230; ?View Code PHP&#160; &#60;?php function dispDay&#40;$i&#41; &#123; switch&#40; floor&#40;$i/10&#41; % 10 &#41; &#123; default: switch&#40; $i % [...]]]></description>
			<content:encoded><![CDATA[<p>Displaying the day-part of the date, followed by the month etc. just looks plain wrong and lazy &#8211; &#8217;20 September 2009&#8242;.   &#8217;20th&#8217; would look much nicer and can be achieved without too much hard work.  A simple function&#8230;<br />
<span id="more-396"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p396code6'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3966"><td class="code" id="p396code6"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #000000; font-weight: bold;">function</span> dispDay<span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/floor" onclick="pageTracker._trackPageview('/outgoing/www.php.net/floor?referer=');"><span style="color: #990000;">floor</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">10</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
                <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">10</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span> <span style="color: #000088;">$ordinal</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'st'</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">:</span> <span style="color: #000088;">$ordinal</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'nd'</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">:</span> <span style="color: #000088;">$ordinal</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'rd'</span><span style="color: #339933;">;</span>   
                <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span> <span style="color: #000088;">$ordinal</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'th'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$i</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;sup&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$ordinal</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/sup&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/php/english_ordinals_for_dates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Catching a keyPress..</title>
		<link>http://www.maggsweb.com/html/catching-a-keypress/</link>
		<comments>http://www.maggsweb.com/html/catching-a-keypress/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 10:51:33 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://tech.maggsweb.co.uk/?p=291</guid>
		<description><![CDATA[&#8230;like &#8216;Enter&#8217; for instance. ?View Code JAVASCRIPTfunction handleEnter (field, event) { var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (keyCode == 13) { //do something, eg: submitForm(); } else { return true; } }]]></description>
			<content:encoded><![CDATA[<p>&#8230;like &#8216;Enter&#8217; for instance.</p>
<p><span id="more-291"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p291code8'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2918"><td class="code" id="p291code8"><pre class="javascript" style="font-family:monospace;">function handleEnter (field, event) {
  var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
  if (keyCode == 13) { 
        //do something, eg:
	submitForm();
  } else {
   return true;
  }
}</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/html/catching-a-keypress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Print a Page, or Print a Section</title>
		<link>http://www.maggsweb.com/html/print-a-page-or-print-a-section/</link>
		<comments>http://www.maggsweb.com/html/print-a-page-or-print-a-section/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 10:08:31 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://tech.maggsweb.co.uk/?p=289</guid>
		<description><![CDATA[This is another functionality that I have been looking or for a while. I haven&#8217;t tried it yet, but intend to add this to my default toolbox! I am sticking it here for now &#8211; and will update this when I have used it. ?View Code JAVASCRIPT&#160; function printPageComponent() { html = '&#60;div id=&#34;print-page&#34;&#62;'; html [...]]]></description>
			<content:encoded><![CDATA[<p>This is another functionality that I have been looking or for a while.  I haven&#8217;t tried it yet, but intend to add this to my default toolbox!  I am sticking it here for now &#8211; and will update this when I have used it.</p>
<p><span id="more-289"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p289code10'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p28910"><td class="code" id="p289code10"><pre class="javascript" style="font-family:monospace;">&nbsp;
function printPageComponent() {
  html  = '&lt;div id=&quot;print-page&quot;&gt;';
  html += '  &lt;input class=&quot;button&quot; \n';
  html += '         id=&quot;print-page-button&quot; \n';
  html += '         onclick=&quot;window.print();&quot; \n';
  html += '         onmouseup=&quot;this.blur();&quot; \n';
  html += '         title=&quot;Print the current page.&quot; \n';
  html += '         type=&quot;button&quot; \n';
  html += '         value=&quot;Print this page&quot;';
  html += '   /&gt;';
  html += '&lt;/div&gt;';
  return html;
}
&nbsp;
function printPageLink() {
  html  = &quot;&lt;span id=\&quot;component-box-print-link\&quot; \n&quot;;
  html += &quot;      class=\&quot;button\&quot;\n&quot;;
  html += &quot;      onclick=\&quot;window.print();\&quot;&gt;\n&quot;;
  html += &quot;Print this page&quot;;
  html += &quot;&lt;/span&gt;&quot;;
  return html;
}</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/html/print-a-page-or-print-a-section/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross-browser bookmark link</title>
		<link>http://www.maggsweb.com/html/cross-browser-bookmark-link/</link>
		<comments>http://www.maggsweb.com/html/cross-browser-bookmark-link/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 09:56:56 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://tech.maggsweb.co.uk/?p=284</guid>
		<description><![CDATA[&#8216;Bookmark Me&#8217; is a sort of IE thing and doesn&#8217;t usually work in FireFox, Safari, Chrome, etc.. so as a FireFox user I&#8217;ve never bothered with a bookmark links before. FireFox users know that Ctrl+D is the shortcut for these browsers, and that most &#8216;Bookmark Me&#8217; links just aren&#8217;t work clicking &#8211; as they won&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>&#8216;Bookmark Me&#8217; is a sort of IE thing and doesn&#8217;t usually work in FireFox, Safari, Chrome, etc.. so as a FireFox user I&#8217;ve never bothered with a bookmark links before.<br />
FireFox users know that Ctrl+D is the shortcut for these browsers, and that most &#8216;Bookmark Me&#8217; links just aren&#8217;t work clicking &#8211; as they won&#8217;t work.</p>
<p>And then I found this&#8230;</p>
<p><span id="more-284"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p284code12'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p28412"><td class="code" id="p284code12"><pre class="javascript" style="font-family:monospace;">&nbsp;
function bookmarkIt(){
if(document.all){
   window.external.AddFavorite(location.href,document.title);
   }
else if(window.sidebar){
   window.sidebar.addPanel(document.title,location.href,'');
   }
}</pre></td></tr></table></div>

<p>&#8230;although I haven&#8217;t actually used it yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/html/cross-browser-bookmark-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flickering images inside &lt;a&gt;&#8217;s</title>
		<link>http://www.maggsweb.com/html/flickering-images-inside-links/</link>
		<comments>http://www.maggsweb.com/html/flickering-images-inside-links/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 15:18:48 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://tech.maggsweb.co.uk/?p=278</guid>
		<description><![CDATA[In IE6 and sometimes in IE7 the background images flicker if they’re also an &#60;a&#62;.  A small edition to .htaccess overrides the browsers default to load the backgrounds every time. ExpiresActive On ExpiresByType image/gif A2592000 ExpiresByType image/jpeg A2592000 ExpiresByType image/png A2592000 Reqires mod_expire on an Apache server (most have it).]]></description>
			<content:encoded><![CDATA[<p>In IE6 and sometimes in IE7 the background images flicker if they’re also an &lt;a&gt;.  A small edition to .htaccess overrides the browsers default to load the backgrounds every time.</p>
<p><span id="more-278"></span></p>
<pre>
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/png A2592000
</pre>
<p>Reqires mod_expire on an Apache server (most have it).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/html/flickering-images-inside-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Error redirects with .htaccess</title>
		<link>http://www.maggsweb.com/html/custom-error-redirects/</link>
		<comments>http://www.maggsweb.com/html/custom-error-redirects/#comments</comments>
		<pubDate>Thu, 07 May 2009 12:37:55 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://tech.maggsweb.co.uk/?p=238</guid>
		<description><![CDATA[Cold hard website errors are horrible and unnecessary. All you need is a few nice looking .html files in your directory somewhere, then use .htaccess to reditrect to these when there is an error. Obviously, no errors at all would be better&#8230;. The format for the .htaccess is : ErrorDocument errornumber /file.html For example, if [...]]]></description>
			<content:encoded><![CDATA[<p>Cold hard website errors are horrible and unnecessary.  All you need is a few nice looking .html files in your directory somewhere, then use .htaccess to reditrect to these when there is an error.  Obviously, no errors at all would be better&#8230;. <img src='http://www.maggsweb.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<span id="more-238"></span><br />
The format for the .htaccess is :</p>
<p><strong>ErrorDocument errornumber /file.html</strong></p>
<p>For example,  if the file notfound.html was in the root directory of my site and I wanted to use it for a 404 error I would use:</p>
<p><strong>ErrorDocument 404 /notfound.html</strong></p>
<p>If the file is not in the root directory of your site, you just need to put the path to it:</p>
<p><strong>ErrorDocument 500 /errorpages/500.html</strong></p>
<p>These are some of the most common errors:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p238code14'); return false;">View Code</a> APACHE</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p23814"><td class="code" id="p238code14"><pre class="apache" style="font-family:monospace;"><span style="color: #ff0000;">401</span> - Authorization Required
<span style="color: #ff0000;">400</span> - Bad request
<span style="color: #ff0000;">403</span> - Forbidden
<span style="color: #ff0000;">500</span> - Internal Server Error
<span style="color: #ff0000;">404</span> - Wrong page</pre></td></tr></table></div>

<p>and they can all be redirected to the same page, different pages, or even a dynamic page&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/html/custom-error-redirects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detecting a mobile browser</title>
		<link>http://www.maggsweb.com/php/detecting-a-mobile-browser/</link>
		<comments>http://www.maggsweb.com/php/detecting-a-mobile-browser/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 12:16:07 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[mobile browser]]></category>

		<guid isPermaLink="false">http://tech.maggsweb.co.uk/?p=226</guid>
		<description><![CDATA[I have often looked at my sites on my mobile.  Some look good, others look really bad &#8211; usually down to some clever fancy-arse stuff that wouldn&#8217;t even work on a mobile. So, I have finally found this article that reckons it is sussed.  I&#8217;m gonna try it out. ?View Code PHP&#60;?php if&#40;checkmobile&#40;&#41;&#41; &#123; header&#40;&#34;Location:http://www.whatever-url-you-want.com&#34;&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p>I have often looked at my sites on my mobile.  Some look good, others look really bad &#8211; usually down to some clever fancy-arse stuff that wouldn&#8217;t even work on a mobile.</p>
<p>So, I have finally found this <a href="http://www.brainhandles.com/techno-thoughts/detecting-mobile-browsers" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.brainhandles.com/techno-thoughts/detecting-mobile-browsers?referer=');">article</a> that reckons it is sussed.  I&#8217;m gonna try it out.<br />
<span id="more-226"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p226code16'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p22616"><td class="code" id="p226code16"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>checkmobile<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a href="http://www.php.net/header" onclick="pageTracker._trackPageview('/outgoing/www.php.net/header?referer=');"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location:http://www.whatever-url-you-want.com&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Use like this....</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> checkmobile<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset" onclick="pageTracker._trackPageview('/outgoing/www.php.net/isset?referer=');"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_X_WAP_PROFILE&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/preg_match" onclick="pageTracker._trackPageview('/outgoing/www.php.net/preg_match?referer=');"><span style="color: #990000;">preg_match</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/wap\.|\.wap/i&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_ACCEPT&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset" onclick="pageTracker._trackPageview('/outgoing/www.php.net/isset?referer=');"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_USER_AGENT&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/preg_match" onclick="pageTracker._trackPageview('/outgoing/www.php.net/preg_match?referer=');"><span style="color: #990000;">preg_match</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/Creative\ AutoUpdate/i&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_USER_AGENT&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$uamatches</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array" onclick="pageTracker._trackPageview('/outgoing/www.php.net/array?referer=');"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;midp&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;j2me&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;avantg&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;docomo&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;novarra&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;palmos&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;palmsource&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;240x320&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;opwv&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;chtml&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;pda&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;windows\ ce&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;mmp\/&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;blackberry&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;mib\/&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;symbian&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;wireless&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;nokia&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;hand&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;mobi&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;phone&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;cdm&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;up\.b&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;audio&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;SIE\-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;SEC\-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;samsung&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;HTC&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;mot\-&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;mitsu&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;sagem&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;sony&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;alcatel&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;lg&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;erics&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;vx&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;NEC&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;philips&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;mmm&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;xx&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;panasonic&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;sharp&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;wap&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;sch&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;rover&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;pocket&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;benq&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;java&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;pt&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;pg&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;vox&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;amoi&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;bird&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;compal&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;kg&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;voda&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;sany&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;kdd&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;dbt&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;sendo&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;sgh&quot;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">&quot;gradi&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;jb&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;\d\d\di&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;moto&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$uamatches</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$uastring</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/preg_match" onclick="pageTracker._trackPageview('/outgoing/www.php.net/preg_match?referer=');"><span style="color: #990000;">preg_match</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$uastring</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/i&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;HTTP_USER_AGENT&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/php/detecting-a-mobile-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shortcut Icon (favicon.ico)</title>
		<link>http://www.maggsweb.com/html/shortcut-icon-faviconico/</link>
		<comments>http://www.maggsweb.com/html/shortcut-icon-faviconico/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 17:45:55 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://tech.maggsweb.co.uk/?p=214</guid>
		<description><![CDATA[In short, a 16x16px bitmap, renamed, in the web root. Or is it? This minimal approach does actually work, but done properly, they should have a few different size versions in the same file, so that not only do they show in the URL bar, and now more recently in the tabs as well (IE8+, [...]]]></description>
			<content:encoded><![CDATA[<p>In short, a 16x16px bitmap, renamed, in the web root.  Or is it?  </p>
<p>This minimal approach does actually work, but done properly, they should have a few different size versions in the same file, so that not only do they show in the URL bar, and now more recently in the tabs as well (IE8+, FF3+), but also display a different (clearer) version when dragged to the desktop.<br />
<span id="more-214"></span><br />
I have been using an online tool for a few years to make mine and it&#8217;s great.<br />
<a href="http://tools.dynamicdrive.com/favicon/" target='_new' onclick="pageTracker._trackPageview('/outgoing/tools.dynamicdrive.com/favicon/?referer=');">http://tools.dynamicdrive.com/favicon/</a><br />
Try and use the best format that you have, but MAKE IT SQUARE first, otherwise it will get squashed.</p>
<p>Use this code to in the &lt;head&gt; section to add it..</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p214code18'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p21418"><td class="code" id="p214code18"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;shortcut icon&quot;
      href=&quot;favicon.ico&quot;
      type=&quot;image/x-icon&quot;&gt;
&lt;link rel=&quot;icon&quot; href=&quot;favicon.ico&quot; /&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.maggsweb.com/html/shortcut-icon-faviconico/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

