]+)\s([^>]+)>/'; // Matches "@" return preg_match($pattern); } if (str_contains($url, ".txt#")) { } */ if (stristr($source, $_POST['target'])) { header($_SERVER['SERVER_PROTOCOL'] . ' 202 Accepted'); # Now do something with $source e.g. parse it for h-entry and h-card and store what you find. $logfile = './mentions.txt'; /* Make sure file is writeable */ $log = date("Y-m-d\TH:i:s\Z") . "\t" ."Recived webmention from ".$_POST['source'] ." mentioning ".$_POST['target'] //." (IP: ".$_SERVER['REMOTE_ADDR'].")" .PHP_EOL; file_put_contents($logfile, $log, FILE_APPEND); } else { header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request'); exit; } ?>