Reputation: 7348
<?PHP
if (ereg("www\.test", $_SERVER['HTTP_REFERER']) != true)
{
header("location http://www.example.com");
end;
}
echo "111";
//dosomting?
?>
It still not working
Upvotes: 0
Views: 1137
Reputation: 163318
Try this:
<?php
if (!preg_match("www\.test", $_SERVER['HTTP_REFERER'])) {
header("Location: http://www.example.com");
exit();
}
//do stuff...
?>
Upvotes: 3