ohh
i have put the code you posted and did what you instructed for but no result and no errors also.
now i will show you what i have done exactly in this part
and could you help me is this criteria true or not?
here is my way:
1- make a log.php file
2- make a table in the data base and its variables are:
ip, agent, ref, query, date
then this is the code:
Code:
<?php
$ip = $_SERVER['REMOTE_ADDR']; //Get there ip address.
$agent = $_SERVER['HTTP_USER_AGENT']; //Get there user agent, Firefox etc, and some other info about it.
$ref = $_SERVER['HTTP_REFERER']; // Referer, how they got to your website, who linked them, where they clicked that link.
$uri = $_SERVER['REQUEST_URI']; //The URI which was given in order to access this page; for instance, '/index.html'.
$date = date("H:i dS F"); //Get the date and time.
//To save the logging data in the Data base
$mySQL_host = "localhost";
$mySQL_user = "my user name";
$mySQL_pwd = "my pwd";
$DataBase = "my db name";
$message = "IP: " . $ip . "USERAGENT: " . $agent . " REFERRER: " . $ref . " SEARCHSTRING: " . $query . " DATE: " . $date;
$mySQL_ID = mysql_connect($mySQL_host, $mySQL_user, $mySQL_pwd) or die ('I cannot connect to the database because: ' . mysql_error(). '');
$mySQLBOOL = mysql_select_db($DataBase,$mySQL_ID) or die ('Database problems because: ' . mysql_error(). '');
mysql_query("INSERT INTO tablename VALUES('$message')");
?>
then i reffered to this log.php file in the logout.php file
but there is nothing saved in the database
is this true or what?
thanks alot