<?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>TechPHP.org&#187; Web Design</title>
	<atom:link href="http://www.techphp.org/category/general/web-design/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techphp.org</link>
	<description>Web development journal</description>
	<lastBuildDate>Tue, 15 Dec 2009 00:04:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Blog HTML Validity and plug-ins</title>
		<link>http://www.techphp.org/general/html/blog-html-validity-and-plugins/</link>
		<comments>http://www.techphp.org/general/html/blog-html-validity-and-plugins/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 01:34:20 +0000</pubDate>
		<dc:creator>simon</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[html validity]]></category>
		<category><![CDATA[page rank]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[syntax highlighter]]></category>
		<category><![CDATA[validator]]></category>
		<category><![CDATA[w3C]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://techphp.net/?p=113</guid>
		<description><![CDATA[Maintaining the Wordpress blog valid to the declared HTML standard seems to be not very easy if many plug-ins are used. In fact, every plug-in contributes a piece of code to the page and sometimes breaks the HTML validity. Since plug-ins can be upgraded by a simple click in the dashboard, an error can be [...]]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 3px 10px; float:left;" title="invalid-xhtml10" src="http://www.techphp.org/wp-content/uploads/2008/12/invalid-xhtml10.png" alt="invalid-xhtml10" width="88" height="31" />Maintaining the <a href="http://techphp.net/wp/" target="_self">Wordpress blog</a> valid to the declared HTML standard seems to be not very easy if many <a href="http://techphp.net/wp/plugins/" target="_self">plug-ins</a> are used. In fact, every plug-in contributes a piece of code to the page and sometimes breaks the HTML validity. Since plug-ins can be upgraded by a simple click in the dashboard, an error can be simply delivered and installed to your Blog. Thus, a re-check in a HML Validator of your choice is desireable after every new plugin upgrade. I prefer to use <a href="http://validator.w3.org/">W3C Validator</a> for checks.</p>
<p>Apparently, I realized running my monthly <a href="http://www.seitwert.de/" target="_blank">seitwert</a>-check, that the one of my pages got errors because of one of the plug-in installed. This time it was <a href="http://wordpress.org/extend/plugins/google-syntax-highlighter">Google Syntax Highlighter for WordPress</a> by <a href="http://www.peterryan.net/">Peter Ryan</a>. Instead of using the <code>type="text/javascript"</code> inside of <code>script</code>-tag, the <code>class="javascript"</code> is used. The bug could be easily fixed locally by replacing the corresponding pieces of code. Peter seems to be not interested anymore in maintaining the plug-in, since there is a long list of comments claiming and voting for the bug.</p>
<p>Especially, if you think of the fact, that the usage of invalid (X)HTML effects your page rank by search engines and other directories in a very negative way, such hidden standards violations should be avoided.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techphp.org/general/html/blog-html-validity-and-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Browser detection in PHP</title>
		<link>http://www.techphp.org/general/browser-detection-in-php/</link>
		<comments>http://www.techphp.org/general/browser-detection-in-php/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 21:32:10 +0000</pubDate>
		<dc:creator>lexa</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[difference]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[msie]]></category>
		<category><![CDATA[opera]]></category>

		<guid isPermaLink="false">http://techphp.net/?p=25</guid>
		<description><![CDATA[It was short time ago. I was sitting in my room and thinking about browser-problems in this great and sick world. Then I went to the kitchen to make a tea, but made a coffee, because I was thinking about another things. Just like the programmers of the browsers, they wanted to make a best [...]]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 10px; float: right;" title="browsers" src="http://www.techphp.org/wp-content/uploads/2008/12/browsers.png" alt="browsers" width="270" height="180" />It was short time ago. I was sitting in my room and thinking about browser-problems in this great and sick world. Then I went to the kitchen to make a tea, but made a coffee, because I was thinking about another things. Just like the programmers of the browsers, they wanted to make a best browser ever, but they failed.</p>
<p>So, now about our problem. We want make our application working in all browsers, because it&#8217;s good to make it work everywhere. So we have to aks the user agent (basically the client program, not the agent Smith from Matrix), what browser are you using? And we want make it so flexible, that we can ask him this every time. For this purpose we introduce a function:</p>
<pre class="brush: php;">
function getBrowser()
{
  $ua = $_SERVER['HTTP_USER_AGENT']
  if (strstr($ua,'Opera')) {  // Opera
    $browser = ereg_replace(&quot;.+\(.+\) (Opera |v){0,1}([0-9,\.]+)[^0-9]*&quot;,&quot;Opera\\2&quot;,$ua);
    if(ereg('^Opera/.*',$ua)) {
      $browser = ereg_replace(&quot;Opera/([0-9,\.]+).*&quot;,&quot;Opera \\1&quot;,$ua);
    }
  } elseif (strstr($ua,'MSIE')) { // MSIE
    $browser=ereg_replace(&quot;.+\(.+MSIE ([0-9,\.]+).+&quot;, &quot;Internet Explorer \\1&quot;,$ua);
  } elseif (strstr($ua,'Firefox')) { // Firefox
    $browser=ereg_replace(&quot;.+\(.+rv:.+\).+Firefox/(.*)&quot;, &quot;Firefox \\1&quot;, $ua);
  } elseif (strstr($ua,'Mozilla')) {  //  Mozilla
    $browser=ereg_replace(&quot;.+\(.+rv:([0-9,\.]+).+&quot;,&quot;Mozilla \\1&quot;,$ua);
  } else {  // None of them.
    $browser=$ua;
  }
  return $browser;
}
</pre>
<p>If we want our PHP script to show us the browser, we write:</p>
<pre class="brush: php;">
echo(getBrowser());
</pre>
<p>Now we can see, what kind of browser is used and use it in our aplication:</p>
<pre class="brush: php;">
if (getBrowser() == 'Internet Explorer 6.0') {
echo (&quot;Please install another Browser&quot;);
}
</pre>
<p>Thats it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techphp.org/general/browser-detection-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
