Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ellenőrző
- <?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 domain 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><input type='radio' name='radiobtn' value='$domain' checked/>".$domain; echo " <font color='#00FF00'>Szabad</color></td></tr>";
- }
- else echo "<tr><td>$domain</td><td><font color='#FF0000'>Foglalt</color></td></tr>";
- }
- if (isset($_POST['megrendbtn'])) {
- $radiobutton = (isset($_POST['radiobtn'])) ? $_POST['radiobtn'] : '';
- echo("
- <script language='javascript'>
- location.href='viewpage.php?page_id=1¶meter=$radiobutton'
- </script>
- ");
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- </head>
- <body>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="domain">
- Domain name:
- <table width="155" height="368">
- <tr>
- <td> </td>
- <td><input name="domainname" type="text" /></td></tr>
- <tr>
- <td width="30"> </td>
- <td><input type="checkbox" name="hu" checked/>.hu</td></tr>
- <tr>
- <td> </td>
- <td><input type="checkbox" name="eu" checked/>.eu</td></tr>
- <tr>
- <td> </td>
- <td><input type="checkbox" name="com" checked/>.com</td></tr>
- <tr>
- <td> </td>
- <td><input type="checkbox" name="net" checked/>.net</td></tr>
- <tr>
- <td> </td>
- <td><input type="checkbox" name="org" checked/>.org</td></tr>
- <tr>
- <td> </td>
- <td><input type="checkbox" name="info" checked/>.info</td></tr>
- <tr>
- <td> </td>
- <td><input type="checkbox" name="biz" checked/>.biz</td></tr>
- <tr>
- <td> </td>
- <td><input type="checkbox" name="name" checked/>.name</td></tr>
- <tr>
- <td> </td>
- <td><input type="checkbox" name="cc" checked/>.cc</td></tr>
- <tr>
- <td> </td>
- <td><input type="checkbox" name="tv" checked/>.tv</td></tr>
- <tr>
- <td> </td>
- <td><input type="checkbox" name="de" checked/>.de</td></tr>
- <tr>
- <td> </td>
- <td><input type="checkbox" name="at" checked/>.at</td></tr>
- <tr>
- <td> </td>
- <td><input type="submit" name="submitBtn" value="Check domain"/></td></tr>
- </table>
- <?php
- // The form was submitted
- if (isset($_POST['submitBtn'])){
- $domainbase = (isset($_POST['domainname'])) ? $_POST['domainname'] : '';
- $d_hu = (isset($_POST['hu'])) ? 'hu' : '';
- $d_eu = (isset($_POST['eu'])) ? 'eu' : '';
- $d_com = (isset($_POST['com'])) ? 'com' : '';
- $d_net = (isset($_POST['net'])) ? 'net' : '';
- $d_org = (isset($_POST['org'])) ? 'org' : '';
- $d_info = (isset($_POST['info'])) ? 'info' : '';
- $d_biz = (isset($_POST['biz'])) ? 'biz' : '';
- $d_name = (isset($_POST['name'])) ? 'name' : '';
- $d_cc = (isset($_POST['cc'])) ? 'cc' : '';
- $d_tv = (isset($_POST['tv'])) ? 'tv' : '';
- $d_de = (isset($_POST['de'])) ? 'de' : '';
- $d_at = (isset($_POST['at'])) ? 'at' : '';
- // Check domains only if the base name is big enough
- if (strlen($domainbase)>2){
- echo '<table width="100%">';
- if ($d_hu != '')
- showDomainResult($domainbase.".hu",'whois.nic.hu', 'No match');
- echo '</table>';
- }
- if (strlen($domainbase)>2){
- echo '<table width="100%">';
- if ($d_eu != '')
- showDomainResult($domainbase.".eu",'whois.eu','AVAILABLE'); // jó majd később
- echo '</table>';
- }
- if (strlen($domainbase)>2){
- echo '<table width="100%">';
- if ($d_com != '')
- showDomainResult($domainbase.".com",'whois.crsnic.net','No match for');
- echo '</table>';
- }
- if (strlen($domainbase)>2){
- echo '<table width="100%">';
- if ($d_net != '')
- showDomainResult($domainbase.".net",'whois.crsnic.net','No match for');
- echo '</table>';
- }
- if (strlen($domainbase)>2){
- echo '<table width="100%">';
- if ($d_org != '')
- showDomainResult($domainbase.".org",'whois.publicinterestregistry.net','NOT FOUND');
- echo '</table>';
- }
- if (strlen($domainbase)>2){
- echo '<table width="100%">';
- if ($d_info != '')
- showDomainResult($domainbase.".info",'whois.afilias.net','NOT FOUND');
- echo '</table>';
- }
- if (strlen($domainbase)>2){
- echo '<table width="100%">';
- if ($d_biz != '')
- showDomainResult($domainbase.".biz",'whois.nic.biz','Not found');
- echo '</table>';
- }
- if (strlen($domainbase)>2){
- echo '<table width="100%">';
- if ($d_name != '')
- showDomainResult($domainbase.".name",'whois.nic.name','No match');
- echo '</table>';
- }
- if (strlen($domainbase)>2){
- echo '<table width="100%">';
- if ($d_cc != '')
- showDomainResult($domainbase.".cc",'whois.nic.cc','No match');
- echo '</table>';
- }
- if (strlen($domainbase)>2){
- echo '<table width="100%">';
- if ($d_tv != '')
- showDomainResult($domainbase.".tv",'whois.nic.tv','No match for');
- echo '</table>';
- }
- if (strlen($domainbase)>2){
- echo '<table width="100%">';
- if ($d_de != '')
- showDomainResult($domainbase.".de",'whois.denic.de','free');
- echo '</table>';
- }
- if (strlen($domainbase)>2){
- echo '<table width="100%">';
- if ($d_at != '')
- showDomainResult($domainbase.".at",'whois.nic.at', 'nothing found');
- echo ' </table>';
- if ($domainbase != '')
- { print '<input name="megrendbtn" type="submit" value="Megrendelem"/>';
- }
- else {
- }
- }
- }
- ?></td>
- </tr>
- </form>
- </body>
- Fogadó
- <?php
- $megrendelt = $_GET['parameter'];
- echo $megrendelt;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment