I have a if statement and I am having problem with the 2nd part (&& $refer XOR localhost), What I want is to execute the code if the referer is not any page on http://localhost. I thought I could use a %Like% statement like in mysql but do not think it exists in php. <?php $refer = $_SERVER['HTTP_REFERER']; if((isset($_GET['a'])) && $refer XOR localhost ) { include 'newindex.php'; } else {}?> PHP:
Try this: if ((isset($_GET['a'])) && !strpos($refer, 'localhost')) { PHP: it will execute if $_GET['a'] is set and $refer does not contain string 'localhost';