I have some static html pages that I want to keep the number of views they receive.
All I need to do is pass back the ID of the page which will be written into the page when it is saved.
At the moment I have an onload event in the body tag that calls the following javascript:
Code: Select all
function sendData(advert_id){
var url="my_db_update_file.php?pv=" + advert_id;
window.open(url, "_self");
}Code: Select all
<?php
class dbConnect{
/**/
var $server="localhost";
var $user="user";
var $password="password";
var $database="database";
}
$dbclass = new dbConnect;
mysql_connect($dbclass->server,$dbclass->user,$dbclass->password);
mysql_select_db($dbclass->database);
// update the stats
$add = mysql_query('INSERT INTO `test` (`id`,`passed_val`) VALUES ("","'.$_GET['pv'].'")');
mysql_close();
?>Thanks