0

I have a problem and I don't know if anyone has a solution... I have an online.php script that gets user ip and data and write it on mysql:

$browser     =   $_SERVER['HTTP_USER_AGENT'];

$root = $_SERVER['DOCUMENT_ROOT']; 
include_once ("$root/config.php");

$ip = $_SERVER['REMOTE_ADDR'];

...
$sb4154 = $on124->num_rows;

if ($sb4154 == 0) {
 $url=@$_SERVER['HTTP_REFERER'];
 $ihghg = $mysqli_link->prepare("INSERT INTO online (ip, hora, browser) VALUES (?,now(),?)");
 $ihghg->bind_param('ss', $ip, $browser);
 $ihghg->execute();
 $ihghg->close();
}
else {
 $ihghg = $mysqli_link->prepare("UPDATE online SET `hora` = now() WHERE `ip` = ? LIMIT 1");
 $ihghg->bind_param('s', $ip);
 $ihghg->execute();
 $ihghg->close();
}

it is basically that. (I use ... to sum up).

My php, when you click in a link it opens the image:

<a href="image.jpg">

So the user needs to click back in the browser to see more pictures. The problem is here, when user click back, this include online.php script not work, the UPDATE time not set the hour.

Why it is not working when user click back in browser?

RGS
  • 4,062
  • 4
  • 31
  • 67

0 Answers0