Php Gurus,
It seems according to NotePad++, FILTER_VALIDATE_DOMAIN does not exist. ut ased on this ir does:
So now how to validate domains ?
This is what I tried …
““
<!DOCTYPE HTML>
<html>
<head>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
</head>
<body>
<form method=”GET” name=”submit_link” id=”submit_link” action=<?php echo $_SERVER[‘PHP_SELF’];?>>
<label for=”url”>Url *</label>
<input type=”url” name=”webpage_address” id=”url” placeholder=”Type here your webpage address …” REQUIRED>
<br>
<label for=”email”>Email *</label>
<input type=”email” name=”email_address” id=”email” placeholder=”Type here your email address belonging to your domain …” REQUIRED>
<br>
<label for=”domain”>Domain *</label>
<input type=”domain” name=”domain” id=”domain” placeholder=”Type here your domain belonging to your submitted url …” REQUIRED>
<br>
<button name=”search” id=”search” value=” “>Submit</button>
<br>
<input type=”reset”>
</form>
</body>
</html>
<?php
$submitted_url = $_GET[‘url’];
$submitted_domain = $_GET[‘domain’];
$submitted_email = $_GET[’email’];
if(FILTER_VALIDATE_URL($submitted_url) === ‘FALSE’)
{
die(“Input a VALID url!”);
}
if(FILTER_VALIDATE_EMAIL($submitted_email) === ‘FALSE’)
{
die(“Input a VALID email address!”);
}
if(FILTER_VALIDATE_DOMAIN($submitted_domain) === ‘FALSE’)
{
die(“Input a VALID domain address!”);
}
?>
Show me an example how to validate domains.
PS – The programmers are in a fix how to validate domains. Check here:
Which code sample should I stick to ? Which one will you stick to ? Or maybe you got your own which is a etter one ? In that case let us see what you got.
Thanks