This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(isset($_POST['submit']) && isset($_POST['secret_key']) && $_POST['secret_key'] === 'xx1485DD') { | |
// Block URLs in message field https http www and domains | |
$messageText = $_POST['message']; | |
if (preg_match('/\b(?!https?:\/\/|www\.)\w+\.\w+/i', $messageText)) { | |
die('Sorry, we do not allow URLS in the form.'); | |
} | |