Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<?php
function checkDomain($domain,$server,$findText){
// Open a socket connection to the whois server
$con = fsockopen($server, 43);
if (!$con) return false;
// Send the requested doman name
fputs($con, $domain."\r\n");
// Read and store the server response
$response = ' :';
while(!feof($con)) {
$response .= fgets($con,128);
}
// Close the connection
fclose($con);
// Check the response stream whether the domain is available
if (strpos($response, $findText)){
return true;
}
else {
return false;
}
}
function showDomainResult($domain,$server,$findText){
if (checkDomain($domain,$server,$findText)){
echo "<tr><td>$domain</td><td>AVAILABLE</td></tr>";
}
else echo "<tr><td>$domain</td><td>TAKEN</td></tr>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="domain">
Domain name:
<table>
<tr><td><input name="domainname" type="text" /></td></tr>
<tr><td><input type="checkbox" name="com" checked="checked" />.com</td></tr>
<tr><td><input type="checkbox" name="net" checked="checked" />.net</td></tr>
<tr><td><input type="checkbox" name="bg" checked="checked" />.bg</td></tr>
<tr><td><input type="submit" name="submitBtn" value="Check domain"/></td></tr>
</table>
</form>
<?php
// The form was submitted
if (isset($_POST['submitBtn'])){
$domainbase = (isset($_POST['domainname'])) ? $_POST['domainname'] : '';
$d_com = (isset($_POST['com'])) ? 'com' : '';
$d_com1 = (isset($_POST['net'])) ? 'net' : '';
$d_com2 = (isset($_POST['bg'])) ? 'bg' : '';
// Check domains only if the base name is big enough
if (strlen($domainbase)>2){
echo '<table>';
if ($d_com != '' || $d_com1 != '' || $d_com2 != '')
showDomainResult($domainbase.".com",'whois.crsnic.net','No match for');
showDomainResult($domainbase.".net",'whois.crsnic.net','No match for');
showDomainResult($domainbase.".bg",'whois.crsnic.net','No match for');
echo '</table>';
}
}
?>
</body>
kWo_2 каза:Работи, но може ли да показва само тези които са маркирани, защото сега който и да маркирам показва за всички![]()
<?php
function checkDomain($domain,$server,$findText){
// Open a socket connection to the whois server
$con = fsockopen($server, 43);
if (!$con) return false;
// Send the requested doman name
fputs($con, $domain."\r\n");
// Read and store the server response
$response = ' :';
while(!feof($con)) {
$response .= fgets($con,128);
}
// Close the connection
fclose($con);
// Check the response stream whether the domain is available
if (strpos($response, $findText)){
return true;
}
else {
return false;
}
}
function showDomainResult($domain,$server,$findText){
if (checkDomain($domain,$server,$findText)){
echo "<tr><td>$domain</td><td>AVAILABLE</td></tr>";
}
else echo "<tr><td>$domain</td><td>TAKEN</td></tr>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="domain">
Domain name:
<table>
<tr><td><input name="domainname" type="text" /></td></tr>
<tr><td><input type="checkbox" name="com" value="com" checked="checked" />.com</td></tr>
<tr><td><input type="checkbox" name="net" value="net" checked="checked" />.net</td></tr>
<tr><td><input type="checkbox" name="bg" value="bg" checked="checked" />.bg</td></tr>
<tr><td><input type="submit" name="submitBtn" value="Check domain"/></td></tr>
</table>
</form>
<?php
// The form was submitted
if (isset($_POST['submitBtn'])){
$domainbase = (isset($_POST['domainname'])) ? $_POST['domainname'] : '';
$d_com = (isset($_POST['com'])) ? 'com' : '';
$d_com1 = (isset($_POST['net'])) ? 'net' : '';
$d_com2 = (isset($_POST['bg'])) ? 'bg' : '';
// Check domains only if the base name is big enough
if (strlen($domainbase)>2){
echo '<table>';
if ($d_com != '') {
showDomainResult($domainbase.".com",'whois.crsnic.net','No match for');
}
if ($d_com1 != '') {
showDomainResult($domainbase.".net",'whois.crsnic.net','No match for');
}
if ($d_com2 != '') {
showDomainResult($domainbase.".bg",'whois.crsnic.net','No match for');
}
echo '</table>';
}
}
?>
</body>