Ajax software
Free javascripts
↑
Main Page
<li>Sitemaps</li>
<li>Link Bait</li>
<li>IP Cloaking, Geo-Targeting, and IP Delivery</li>
<li>Foreign Language SEO</li>
<li>Coping with Technical Issues</li>
<li>Case Study: Building an E-Commerce Catalog</li>
<li>Site Clinic: So You Have a Web Site?</li>
<li>: Creating a SE-Friendly Weblog?</li>
<li>Introduction to Regular Expressions</li>
</ol>
</body>
</html>
4.
Create a new file named
popup_utils.inc.php
in your
seophp/include
folder, and write
this code:
<?php
// include config file
require_once ‘config.inc.php’;
// display popup navigation only when visitor comes from a SERP
function display_popup_navigation()
{
// display navigation?
$disp_nav = false;
// if there is no REFERER (visitor loaded popup directly), display navigation
if (!isset($_SERVER[‘HTTP_REFERER’]))
{
$disp_nav = true;
}
// if the REFERER not from our domain, display navigation
else
{
// parse the REFERER and the local site using parse_url()
$parsed_referer = parse_url($_SERVER[‘HTTP_REFERER’]);
$parsed_local = parse_url(SITE_DOMAIN);
// extract the domain of the referer, and that of the local site
$referer_host = $parsed_referer[‘host’];
$local_host = $parsed_local[‘host’];
// display navigation if the REFERER URL is not from the local domain
if ($referer_host != $local_host)
{
$disp_nav = true;
}
}
125
Chapter 6: SE-Friendly HTML and JavaScript
c06.qxd:c06 10:55 125
Ajax software
Free javascripts
→