I have code which detects if referer is from faceebook and shows him/her faceebook popup like box.
It works perfectly from pc with all browsers but it does not work from mobile.
What can I do?
<?php
$ref=$_SERVER['HTTP_REFERER'];
$target_site = "https://www.facebook.com/";
if (isset($_SERVER['HTTP_REFERER']) && preg_match("/".preg_quote($target_site,"/")."/i",$_SERVER['HTTP_REFERER'])) {
include "likebox.php";
}
else {
$line = date('Y-m-d H:i:s') . " - $_SERVER[REMOTE_ADDR]";
file_put_contents('visitors.log', $line . PHP_EOL, FILE_APPEND);
include "nolike.php";
}
?>