JavaScript Editor Ajax software     Free javascripts 



Main Page

// build and execute the INSERT query
$q = “INSERT INTO cloak_data (spider_name, record_type, value) “ .
“VALUES (‘$spider_name’, ‘$record_type’, ‘$value’)“;
mysql_query($q);
}
// delete the cloaking data for the mentioned spider
function _deleteSpiderData($spider_name)
{
// escape input data
$spider_name = mysql_escape_string($spider_name);
// build and execute the DELETE query
$q = “DELETE FROM cloak_data WHERE spider_name=’$spider_name’“;
mysql_query($q);
}
}
?>
9.
Create a file named
cloaking_prepare.php
in your
seophp
folder, and type the following
code. This script only tests the functionality of
SimpleCloak::updateAll()
, which updates
the database with fresh data:
<?php
// load the SimpleCloak library
require_once ‘include/simple_cloak.inc.php’;
// update cloaking data and indicate the success status
if (SimpleCloak::updateAll())
{
echo “Cloaking database updated!”;
}
else
{
echo “Cloaking database was already up to date, or the update failed.”;
}
?>
10.
Load
http://seophp.example.com/cloaking_prepare.php
. If everything works okay, the
page will not simply output “Cloaking database updated!” On any subsequent requests (before
a week elapses), the message should read “Cloaking database was already up to date, or the
update failed.”
11.
However, your
simple_cloak
table from the
seophp
database should be populated with search
engine data. To view the contents of your
simple_cloak
table, you can use the phpMyAdmin
utility that ships with XAMPP. Load the utility through
http://localhost/phpmyadmin/
,
select the
seophp
database from the left pane, and click the Browse button for the
simple_
cloak
table. If everything worked alright, you should see the list of IPs in your table, as shown
in Figure 11-4.
230
Chapter 11: Cloaking, Geo-Targeting, and IP Delivery
c11.qxd:c11 11:01 230


JavaScript Editor Ajax software     Free javascripts