Php – Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash

PHPpreg-match

I get this error on my site and i dont know why:

Warning: preg_match() [function.preg-match]: Delimiter must not be
alphanumeric or backslash

The error is in this function:

if (isset($_REQUEST['page']) AND preg_match("\.\.", $_REQUEST['page'])) {
Header("Location: index.php");
die();

}

Best Answer

You have to enclose the regular expression in delimiters:

if (isset($_REQUEST['page']) AND preg_match("/\.\./", $_REQUEST['page'])) {
     Header("Location: index.php");
     die();
}