мϊкэ
22-07-2005, 02:16 PM
right i keep getting this error on my refferers page and i dont know wats wrong, i get this error message:
Warning: preg_match(): Unknown modifier '/' in /path/to/refferers/refferers.php on line 7
Warning: preg_match(): Unknown modifier ']' in /path/to/refferers/refferers.php on line 10
this is the php code :s ive commented next to line 7 & 10
<?php
include ("config.php");
$ref = $_SERVER['HTTP_REFERER']; //gets the reffering url
preg_match("/^(http://)?([^/]+)/i",
"$ref", $matches); // LINE 7
$host = $matches[2];
preg_match("/[^./]+.[^./]+$/", $host, $matches); // LINE 10
$test1 = mysql_query("SELECT * from ref where domain = '$matches[0]'");
$test = mysql_num_rows($test1);
if ($test == 0)
{
$refinsert = mysql_query("INSERT INTO `ref` ( `domain` , `total`)VALUES ('$matches[0]',
'1')");
}
else
{
$update = mysql_query("UPDATE ref set total = total +1 where domain = '$matches[0]'");
}
?>
Warning: preg_match(): Unknown modifier '/' in /path/to/refferers/refferers.php on line 7
Warning: preg_match(): Unknown modifier ']' in /path/to/refferers/refferers.php on line 10
this is the php code :s ive commented next to line 7 & 10
<?php
include ("config.php");
$ref = $_SERVER['HTTP_REFERER']; //gets the reffering url
preg_match("/^(http://)?([^/]+)/i",
"$ref", $matches); // LINE 7
$host = $matches[2];
preg_match("/[^./]+.[^./]+$/", $host, $matches); // LINE 10
$test1 = mysql_query("SELECT * from ref where domain = '$matches[0]'");
$test = mysql_num_rows($test1);
if ($test == 0)
{
$refinsert = mysql_query("INSERT INTO `ref` ( `domain` , `total`)VALUES ('$matches[0]',
'1')");
}
else
{
$update = mysql_query("UPDATE ref set total = total +1 where domain = '$matches[0]'");
}
?>