PHP Scripts
Track and record referrals to a URL
This script updates a MySQL database, recording traffic from your website to a client URL.
It works by simply incrementing any record in the database, or adding a new entry if none exists, and then referring the browser page on to the URL.
2
pages are involved, a source page, and the count page, in this example index.htm
and go.php.
Clicking "View the Client Website" form button posts
several hidden variables, (if needed) as well, which are stored in the MySQL table.
The table in this example has hits, url, email and dir as 4 fields, where hits
is the number of referrals, url the destination website, email simply to make
posting monthly records easy, and dir the source directory also for posting monthly
records.
Page
VIEWS and then Page REFERRALS
like this can give clients a fair idea of the exposure you are providing.
<html> <FORM NAME="form1" METHOD="post" ACTION="go.php"> <INPUT
TYPE="hidden" NAME="email" VALUE="info@client_url.com"> </FORM> </html> -------- (go.php) <?php
//connect
to the database //store
the update //if
new record } else { //if
updating existing record //and
now to redirect the web browser .. ?> |
$now
";
echo "
$nowm
";
?>