<?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>birghtyoursite &#187; SEO Friendly</title>
	<atom:link href="http://www.brightyoursite.com/blog/tag/seo-friendly/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brightyoursite.com/blog</link>
	<description>Bright your site</description>
	<lastBuildDate>Mon, 19 Dec 2011 09:39:57 +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>use php to get google page rank</title>
		<link>http://www.brightyoursite.com/blog/2010/06/01/use-php-to-get-google-page-rank/</link>
		<comments>http://www.brightyoursite.com/blog/2010/06/01/use-php-to-get-google-page-rank/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 17:37:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SEO Friendly]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[website tools]]></category>

		<guid isPermaLink="false">http://www.brightyoursite.com/blog/?p=445</guid>
		<description><![CDATA[Since the google not give a API or interface to get the google page rank, we have to use google toolbar to get the PR. In order to use php to query toolbarqueries.google.com to the get PR, I did a search ,but most of the codes are too old and can&#8217;t use or not work [...]]]></description>
			<content:encoded><![CDATA[<p>
Since the google not give a API  or  interface to get the google page rank, we have to use google  toolbar to  get the PR. In order to use php to query  toolbarqueries.google.com to the get PR, I did a search ,but most of the codes are too old and can&#8217;t use or not work well, at last i got following script works well.
</p>
<p><span id="more-445"></span></p>
<h3>use php to get google page rank</h3>
<p>
there is all the codes :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> StrToNum<span style="color: #009900;">&#40;</span><span style="color: #000088;">$Str</span><span style="color: #339933;">,</span> <span style="color: #000088;">$Check</span><span style="color: #339933;">,</span> <span style="color: #000088;">$Magic</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$Int32Unit</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">4294967296</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// 2^32</span>
&nbsp;
    <span style="color: #000088;">$length</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$length</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$Check</span> <span style="color: #339933;">*=</span> <span style="color: #000088;">$Magic</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">//If the float is beyond the boundaries of integer (usually +/- 2.15e+9 = 2^31),</span>
        <span style="color: #666666; font-style: italic;">//  the result of converting to integer is undefined</span>
        <span style="color: #666666; font-style: italic;">//  refer to http://www.php.net/manual/en/language.types.integer.php</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000088;">$Int32Unit</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$Check</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$Int32Unit</span> <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check</span> <span style="color: #339933;">/</span> <span style="color: #000088;">$Int32Unit</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #666666; font-style: italic;">//if the check less than -2^31</span>
            <span style="color: #000088;">$Check</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check</span> <span style="color: #339933;">&lt;</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">2147483648</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$Int32Unit</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$Check</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000088;">$Check</span> <span style="color: #339933;">+=</span> <span style="color: #990000;">ord</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Str</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$Check</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//--&gt; for google pagerank</span>
<span style="color: #666666; font-style: italic;">/*
* Genearate a hash for a url
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> HashURL<span style="color: #009900;">&#40;</span><span style="color: #000088;">$String</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$Check1</span> <span style="color: #339933;">=</span> StrToNum<span style="color: #009900;">&#40;</span><span style="color: #000088;">$String</span><span style="color: #339933;">,</span> <span style="color: #208080;">0x1505</span><span style="color: #339933;">,</span> <span style="color: #208080;">0x21</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$Check2</span> <span style="color: #339933;">=</span> StrToNum<span style="color: #009900;">&#40;</span><span style="color: #000088;">$String</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #208080;">0x1003F</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$Check1</span> <span style="color: #339933;">&gt;&gt;=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$Check1</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check1</span> <span style="color: #339933;">&gt;&gt;</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x3FFFFC0</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check1</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x3F</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$Check1</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check1</span> <span style="color: #339933;">&gt;&gt;</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x3FFC00</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check1</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x3FF</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$Check1</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check1</span> <span style="color: #339933;">&gt;&gt;</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x3C000</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check1</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x3FFF</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$T1</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check1</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x3C0</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;&lt;</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check1</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x3C</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;&lt;</span><span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check2</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0xF0F</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$T2</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check1</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0xFFFFC000</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;&lt;</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check1</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x3C00</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;&lt;</span> <span style="color: #208080;">0xA</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Check2</span> <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0xF0F0000</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$T1</span> <span style="color: #339933;">|</span> <span style="color: #000088;">$T2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
   <span style="color: #666666; font-style: italic;">//--&gt; for google pagerank</span>
<span style="color: #666666; font-style: italic;">/*
* genearate a checksum for the hash string
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> CheckHash<span style="color: #009900;">&#40;</span><span style="color: #000088;">$Hashnum</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$CheckByte</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$Flag</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$HashStr</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%u'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$Hashnum</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span>
    <span style="color: #000088;">$length</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$HashStr</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$length</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>  <span style="color: #000088;">$i</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>  <span style="color: #000088;">$i</span> <span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$Re</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$HashStr</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">===</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Flag</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$Re</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$Re</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$Re</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Re</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: #009900;">&#40;</span><span style="color: #000088;">$Re</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: #009900;">&#125;</span>
        <span style="color: #000088;">$CheckByte</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$Re</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$Flag</span> <span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$CheckByte</span> <span style="color: #339933;">%=</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">!==</span> <span style="color: #000088;">$CheckByte</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$CheckByte</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$CheckByte</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">===</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$Flag</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">2</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><span style="color: #cc66cc;">1</span> <span style="color: #339933;">===</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$CheckByte</span> <span style="color: #339933;">%</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$CheckByte</span> <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">9</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000088;">$CheckByte</span> <span style="color: #339933;">&gt;&gt;=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'7'</span><span style="color: #339933;">.</span><span style="color: #000088;">$CheckByte</span><span style="color: #339933;">.</span><span style="color: #000088;">$HashStr</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
        <span style="color: #666666; font-style: italic;">//get google pagerank</span>
<span style="color: #000000; font-weight: bold;">function</span> getpagerank<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$query</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://toolbarqueries.google.com/search?client=navclient-auto&amp;ch=&quot;</span><span style="color: #339933;">.</span>CheckHash<span style="color: #009900;">&#40;</span>HashURL<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&amp;features=Rank&amp;q=info:&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;num=100&amp;filter=0&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$data</span><span style="color: #339933;">=</span>file_get_contents_curl<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//print_r($data);</span>
    <span style="color: #000088;">$pos</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Rank_&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pos</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$pagerank</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pos</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">9</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$pagerank</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> file_get_contents_curl<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_HEADER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Set curl to return the data instead of printing it to the browser.</span>
    <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$data</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</p>
<h3>How to use it</h3>
<p>
Save the previous codes to a pr.php , the test.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include</span> <span style="color: #0000ff;">&quot;pr.php&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$url</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'http://www.brightyoursite.com'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$url</span>  PR is &quot;</span><span style="color: #339933;">.</span> getPagerank<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</p>
<h3>Source File</h3>
<p><strong><a href='http://www.brightyoursite.com/demo/pr.zip'> php get google page rank </a></strong></p>
<h3>live demo</h3>
<p><a href='http://www.brightyoursite.com/demo/pr/test.php' target='_blank'>live demo</a></p>
<h2>Update</h2>
<p>Google have updated the pr search url,please change</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #000088;">$query</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://toolbarqueries.google.com/search?client=navclient-auto&amp;ch=&quot;</span><span style="color: #339933;">.</span>CheckHash<span style="color: #009900;">&#40;</span>HashURL<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&amp;features=Rank&amp;q=info:&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;num=100&amp;filter=0&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>to</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #000088;">$query</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://toolbarqueries.google.com/tbr?client=navclient-auto&amp;ch=&quot;</span><span style="color: #339933;">.</span>CheckHash<span style="color: #009900;">&#40;</span>HashURL<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&amp;features=Rank&amp;q=info:&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;num=100&amp;filter=0&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightyoursite.com/blog/2010/06/01/use-php-to-get-google-page-rank/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>Your first normal wordpress template</title>
		<link>http://www.brightyoursite.com/blog/2010/01/11/your-first-normal-wordpress-template/</link>
		<comments>http://www.brightyoursite.com/blog/2010/01/11/your-first-normal-wordpress-template/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 15:28:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css xhtml]]></category>
		<category><![CDATA[SEO Friendly]]></category>
		<category><![CDATA[w3c validation]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[2 columns layout]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://www.brightyoursite.com/?p=9</guid>
		<description><![CDATA[Introduce Now,let&#8217;s make all together (w3c valid 2 columns xhtml ,ul li css none-js SEO friendly sub-menu),we get a full wordpress home page html template&#8211;Click HERE to view.It looks nice simple &#38; usefull, right ？let&#8217;s start to convert it to wordpress theme. First,We should know some basic wordpress theme Knowledge: What&#8217;s a basic theme include [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduce</h3>
<p>
Now,let&#8217;s make all together (w3c valid 2 columns xhtml ,ul li css none-js SEO friendly sub-menu),we get a full wordpress home page html template&#8211;Click <a target='_blank' href='http://www.brightyoursite.com/demo/2-columns-layout/wordpress-html-template.html' title='wordpress html template'>HERE</a> to view.It looks nice  simple &amp; usefull, right ？let&#8217;s start to convert it to wordpress theme.
</p>
<p><span id="more-9"></span></p>
<p>
First,We should know some basic wordpress theme Knowledge:<br />
<strong>What&#8217;s a basic theme include ?</strong><br/></p>
<ul>
<li>css style (required,style.css,style the page also put your personal info. like theme name , author &#8230;)</li>
<li>index.php (required,WordPress Theme start with this file if without the home.php)</li>
<li>a screenshot (optionally,screenshot.png)</li>
<li>single.php (optionally,this file to generate the  structure for a single post,if no such a file the wordpress will use index.php to generate the structure )</li>
<li>page.php (optionally,this file to generate the  structure for a single page,similar as single.php)</li>
</ul>
<p>so we know a very minimum wordpress theme should include (index.php,style.css) .but usually in order to keep the site in a more good structure and can maxmum reuse , flexible .The page&#8217;s structure is  separated to<br />
several parts:</p>
<ul>
<li> <tt>header.php</tt>
</li>
<li> <tt>sidebar.php</tt>
</li>
<li> <tt>footer.php</tt>
</li>
<li> <tt>comments.php</tt>
</li>
<li> <tt>comments-popup.php</tt>
</li>
</ul>
<p>reference those in the template php file is very easy.For instance,header.php :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_headerer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>the comment, use the  comments_template()  template tag.<br />
the sidebar, use the get_sidebar() template tag.<br />
the footer, use the get_footer() template tag.<br/><br />
Also can use</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span>TEMPLATEPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/script.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>to reference any php file in the  template folder.
</p>
<h3>Start coding wordpress theme now</h3>
<p>
First ,we need declare the theme in style.css .For instance</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
Theme Name: red theme
Theme URI: http://www.brightyoursite.com/blog/2010/01/11/your-first-normal-wordpress-template/
Description:Your first wordpress theme
Version: 1.6
Author: alex 
Author URI:  http://www.brightyoursite.com
Tags: red, fixed width, two columns, widgets 
*/</span></pre></div></div>

<p>you can see the define theme name , url version aurhor &#8230;. there .<br />
Next , do the  page segmentation  and create the header.php , footer.php , sidebar.php and index.php .<br />
to make it easier we can copy the those files from the wordpress default theme . we just need copy our html codes and do some adjustment. for instace change the menu to wordpress page list ：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  &lt;div id=&quot;menus&quot;&gt;
  &lt;ul&gt;
 <span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_pages<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;title_li=&amp;depth=2&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
 &lt;/ul&gt;
  &lt;/div&gt;</pre></div></div>

<p>the main posts loop:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> if <span style="color: #66cc66;">&#40;</span>have_posts<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #000000; font-weight: bold;">?&gt;</span></span> 
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> while <span style="color: #66cc66;">&#40;</span>have_posts<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> : the_post<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000000; font-weight: bold;">&lt;?php</span> post_class<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></span> id=&quot;post-<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></span>&quot;&gt;
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;item_head&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;item_header_text&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;&lt;?php the_permalink() ?&gt;</span></span>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title_attribute<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></span>&quot;&gt;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/a</span><span style="color: #000000; font-weight: bold;">&lt;/h1</span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>					
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;item_description&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Read the rest of this entry &amp;raquo;'</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;tags&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_tags<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Tags: '</span>, <span style="color: #ff0000;">', '</span>, <span style="color: #ff0000;">'&lt;br /&gt;</span></span>');  ?&gt; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>  
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> endwhile; <span style="color: #000000; font-weight: bold;">?&gt;</span></span> 
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;navigation&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;alignleft&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?php</span> next_posts_link<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'&amp;laquo; Older Entries'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;alignright&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?php</span> previous_posts_link<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Newer Entries &amp;raquo;'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
	  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> else : <span style="color: #000000; font-weight: bold;">?&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h2</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Not Found<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h2<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Sorry, but you are looking for something that isn't here.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_search_form<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></span> 
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> endif; <span style="color: #000000; font-weight: bold;">?&gt;</span></span></pre></div></div>

</p>
<h3>Online demo and free wordpress theme download</h3>
<p>
 <a target='_blank' title="red theme has been previewed 1773 times." href="http://www.brightyoursite.com/blog//?themedemo=redtheme">Preview red theme (1773)</a><br />
<br />
<a href='http://www.brightyoursite.com/demo/free-wordpress-theme/redtheme.zip'>Download there</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightyoursite.com/blog/2010/01/11/your-first-normal-wordpress-template/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The simple ul li css SEO friendly  horizontal menu</title>
		<link>http://www.brightyoursite.com/blog/2010/01/10/the-simple-ul-li-css-seo-friendly-horizontal-menu/</link>
		<comments>http://www.brightyoursite.com/blog/2010/01/10/the-simple-ul-li-css-seo-friendly-horizontal-menu/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 15:27:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css xhtml]]></category>
		<category><![CDATA[SEO Friendly]]></category>
		<category><![CDATA[w3c validation]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[w3c valid]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.brightyoursite.com/?p=7</guid>
		<description><![CDATA[In this part we will use ul li css code some simple but usefull seo friendly menu.First let&#8217;s start with a Horizontal Menu with rollover image . we will use images,but most important is we need make it seo friendly. ul li css SEO friendly simple horizontal menu We need prepare 2 images. one for [...]]]></description>
			<content:encoded><![CDATA[<p>
In this part we will use ul li css code some simple but usefull seo friendly menu.First let&#8217;s start with a <strong>Horizontal Menu</strong> with rollover image . we will use images,but most important is we need make it seo friendly.
</p>
<p><span id="more-7"></span><br />
<strong>ul li css SEO friendly  simple horizontal menu</strong></p>
<p>
We need prepare 2 images. one for normal menu background while another for hover &#038; current menu background.That&#8217;s all , very simple . Let&#8217;s look the HTML codes frame:
</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;navs&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ul<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">'Home'</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">'images/normalbg.jpg'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">''</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Home<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">'Portfolio'</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">'images/normalbg.jpg'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">''</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Portfolio<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">'Services'</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">'images/normalbg.jpg'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">''</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Services<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">'Projects'</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">'images/normalbg.jpg'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">''</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Projects<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">'Articles'</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">'images/normalbg.jpg'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">''</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Articles<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">'Contact'</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">'images/normalbg.jpg'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">''</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Contact<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ul<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>
Related css codes:
</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"> <span style="color: #cc00cc;">#navs</span> ul
 <span style="color: #00AA00;">&#123;</span>
	 <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	 <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
 <span style="color: #00AA00;">&#125;</span>
 <span style="color: #cc00cc;">#navs</span> ul li
 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span>inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">46px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/menuover.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
 <span style="color: #00AA00;">&#125;</span>
 <span style="color: #cc00cc;">#navs</span> ul li a
  <span style="color: #00AA00;">&#123;</span>
	 <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	 <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	 <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">46px</span><span style="color: #00AA00;">;</span>
	 <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">46px</span><span style="color: #00AA00;">;</span>
	 <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">131px</span><span style="color: #00AA00;">;</span>
	 <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
	 <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	 <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	 <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	 <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#1F1E1E</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span>
 <span style="color: #cc00cc;">#navs</span> ul li<span style="color: #3333ff;">:hover </span>img
  <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">visibility</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>
Click here to see the <a target='_blank'  title='ul li css SEO friendly  simple horizontal menu' href='http://www.brightyoursite.com/demo/2-columns-layout/simple-ul-li-menu.html'> live demo </a>.
</p>
<p>
<strong>IE6 below Issue</strong><br />
If you have IE6 , You may noticed that this menu rollover image function not work in IE6 and below .<br />
What&#8217;s the solution:<br />
We need use Third-party approach : The  <a target='_blank' title='csshover3.htc'  href='http://www.brightyoursite.com/demo/2-columns-layout/csshover3.htc'>csshover3.htc</a> . Add it to the same  folder of css , then add this line  &#8220;behavior: url(&#8220;csshover3.htc&#8221;);&#8221;  to #navs ul li .So it should like this :<br/></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"> <span style="color: #cc00cc;">#navs</span> ul li
 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span>inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">46px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	behavior<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;csshover3.htc&quot;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/menuover.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">;</span>
 <span style="color: #00AA00;">&#125;</span></pre></div></div>

</p>
<p>
But this cause a inssue : the css can&#8217;t pass w3c valid .i tried many ways , but didn&#8217;t figure it out. if someone have a more good solution,please let me know.<a target='_blank'  title='ul li css SEO friendly  simple horizontal menu' href='http://www.brightyoursite.com/demo/2-columns-layout/simple-ul-li-menu-final.html'> Click here </a> to see the final version .DownLoad  <a title='ul li css SEO friendly  simple horizontal menu download' href='http://www.brightyoursite.com/demo/2-columns-layout/simplemenu.zip'>HERE</a> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightyoursite.com/blog/2010/01/10/the-simple-ul-li-css-seo-friendly-horizontal-menu/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

