<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Domain checker</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div id="wrapper">
<form method="POST">
<input type="text" name="domain" <?php if(isset($_POST['domain'])) echo 'value="'.$_POST['domain'].'"' ?>>
<button type="submit">Check</button>
</form>
<div class="result">
<?php
if(isset($_POST['domain'])){
if ( gethostbyname($_POST['domain']) == $_POST['domain'] )
echo "<p class='success'>Congatulations! {$_POST['domain']} is available</p>";
else
echo "<p class='failur'>Sorry, {$_POST['domain']} is not available</p>";
}
?>
</div>
</div>
</body>
</html>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter