<?php
if(isset($_POST['submit'])){
$input = $_POST['input'];
if(preg_match('#^https?://#i', $input)){
header("Location: https://vir9.com");
exit();
}
}
?>
another ex
<?php
if($_POST['submit-board']) {
$url=$_POST['url'];
$thai=$_POST['thai'];
$topic=$_POST['topic'];
$detail=$_POST['detail'];
$tel=$_POST['tel'];
$email=$_POST['email'];
$ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
// check if URL is entered and redirect to cymiz.com if it is
if(preg_match('#^https?://#i', $url)){
header("Location: https://vir9.com");
exit();
} else {
// send the email if the URL is not redirected
$to = "xxx@vir9.com";
$subject = "vir9.com $thai"; //1
$sub="..."; //2
// send the email using the mail() function
mail($to,$subject,$sub,"From: $email");
}
}
?>