Page double executuon

kotofei

New Member
Messages
11
Reaction score
0
Points
0
I have wierd problem - seems like page executes twice.

I have simple php code to insert ip, referer and browser info in mysql db. When i load my page and then look into db, i am seeing:

85.141.154.237 Opera/9.24 (Windows NT 5.1; U; en) 2007-10-31 08:13:30
85.141.154.237 Opera/9.24 (Windows NT 5.1; U; en) 2007-10-31 08:13:32

So everytime i reload it, i get to mostly identical entries.

I also tried to write a script for storing info in text file, and it also writed to identical strings.

Help me please!
P.S Sorry for my bad english.
 

athiwatc

New Member
Messages
155
Reaction score
0
Points
0
File please ??
How could i help you with no script
 
Last edited:

kotofei

New Member
Messages
11
Reaction score
0
Points
0
PHP:
<?php 

if ($_SERVER['HTTP_USER_AGENT']) {
	$browser = $_SERVER['HTTP_USER_AGENT'];
	echo $browser;
}

if ($_SERVER['REMOTE_ADDR']) {
	$ip = $_SERVER['REMOTE_ADDR'];
	echo ", " . $ip;
}

if ($_SERVER['QUERY_STRING']) {
	$query = $_SERVER['QUERY_STRING'];
	echo ", " . $query;
}

if ($_SERVER['HTTP_REFERER']) {
	$referer = $_SERVER['HTTP_REFERER'];
	echo ", " . $referer;
}

if ($_COOKIE) {
	echo ", ";
	print_r($_COOKIE);
}

echo $data;
include_once('mysql_settings.php');

mysql_query("INSERT INTO log (ip, browser, referer) VALUES('$ip', '$browser', '$referer') ") or die(mysql_error());
mysql_close($con);

echo "<br>Data logged";
?>
 
Top