PDA

View Full Version : Refferers Script error? >:-|



мϊкэ
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]'");
}
?>

Dan Williamson
22-07-2005, 03:10 PM
Have You Created Your MYSQL Database?

мϊкэ
22-07-2005, 03:40 PM
do you really think im that stupid :@ im insulted by that comment and you dont seem to have a clue wat im talkin about :rolleyes: there is a problem on the lines i stated and your talking about mysql :o

Mentor
22-07-2005, 03:57 PM
i havent slept in almost 3 days so my responce probly will make little sence, anyway, you need to slash out some of the stuff in the preg match to stop it genirating before it should ect, the currant problem is i cant currantly rember exsactly what needs to be slashed out and what doesnt lol "/

anyway, i think thats the problem

Dan Williamson
22-07-2005, 07:38 PM
o.O Sorry Didn't Read All The Problem I Saw MYSQl Problems Soz Dude Lol.

Anderman
22-07-2005, 08:50 PM
No mysql errors there
:/

Want to hide these adverts? Register an account for free!