snails07 Posted November 29, 2010 Share Posted November 29, 2010 here is my code below PHP Code: <?php $referer = $_SERVER['HTTP_REFERER']; if (preg_match('/\/search\//', $referer)); {?> <p><a href="javascript:history.back(-1);">Previous Page</a></p> <?php } ?> I am basically trying to say that if the users previous page url contained the word ‘search’ (ie. Coming from the search page) then display the javascript back link. It displays the link even if the previous page url does not contain the word ‘search’. What have I done wrong here?? Thanks in advance Link to comment https://forums.phpfreaks.com/topic/220102-preg_match-not-working/ Share on other sites More sharing options...
salathe Posted November 29, 2010 Share Posted November 29, 2010 Why is there a semi-colon on the line with preg_match ? Link to comment https://forums.phpfreaks.com/topic/220102-preg_match-not-working/#findComment-1140797 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.