Jump to content


Referer in MYSQL


2 replies to this topic

#1 QuietWhistler

    Young Padawan

  • Members
  • Pip
  • 19 posts

Posted 12 July 2005 - 05:15 AM

Hi,

this is the code i used to put some info into a MYSQL database :

<?php
include("connect.php");
$date = date("M, d, Y");
$ip = $_SERVER['REMOTE_ADDR'];
$referer = $_SERVER['HTTP_REFERER'];
$browser = $_SERVER['HTTP_USER_AGENT'];
$hitadd = mysql_query("INSERT INTO stats(date,ip,referer,browser)"."VALUES('$date','$ip','$referer','$browser')");
?>


But when i open my MYSQL table, the referer is just empty, rest works normally. Hope you can help me.

thanks

#2 softLearner

    Young Padawan

  • Members
  • Pip
  • 128 posts

Posted 12 July 2005 - 05:23 AM

In order for the refer to be submited you'll have to make another with a link going to the page with that script.

If you goto the page with script directly by ttyping it in the browser than theres is no referer. So in order to do it you'll have to make a link going t that page.

#3 QuietWhistler

    Young Padawan

  • Members
  • Pip
  • 19 posts

Posted 12 July 2005 - 05:44 AM

ok thanks :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users