I have a code like this, and it's included at a html page. But this insert-clause doesn't work. I thought it would work as the page is loaded. Why doesn't it? What should I do?
<?php
include_once("functions.php");
//get visitor's ip address
if (getenv(HTTP_X_FORWARDED_FOR)){
$ip = getenv(HTTP_X_FORWARDED_FOR);
}
else {
$ip = getenv(REMOTE_ADDR);
}
//get date
$pvm = date("j.n.Y");
//get the page visitor comes from
$sivu = getenv("HTTP_REFERER");
$insert = "INSERT INTO kayttajainfo (ip, pvm, sivu) VALUES ('$ip', '$pvm', '$sivu')";
?>
Thank you so much!