Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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>$domain</td><td>AVAILABLE</td></tr>";
- echo "<input type='radio' name='radiobtn' value='$domain' checked/>".$domain;
- }
- else echo "<tr><td>$domain</td><td>TAKEN</td></tr>";
- }
- if ($beirhat == 'NYOMJAD')
- {
- $domainbase = (isset($_POST['domainname'])) ? $_POST['domainname'] : '';
- $d_hu = (isset($_POST['hu'])) ? 'hu' : '';
- $d_eu = (isset($_POST['eu'])) ? 'eu' : '';
- // 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');
- echo("</table>");
- };
- echo ("<form method='post' action=$PHP_SELF name='domain'>
- <table width='60%' border='0'>
- <tr>
- <td><div align='center'><input type='submit' name='beirhat' value='ROGZITES'></div></td>
- </tr>
- </table>
- </form>");
- }
- elseif ($beirhat=='ROGZITES')
- {$atad='ide kő vmi';
- echo("
- <SCRIPT LANGUAGE='JavaScript'>
- location.href='megnyit.php?atad=$atad'
- </SCRIPT>
- ");
- }
- else
- {
- echo("<form method='post' action=$PHP_SELF name='domain'>
- <table>
- <tr>
- <td> </td>
- <td><input name='domainname' type='text' /></td>
- </tr>
- <tr>
- <td><input type='checkbox' name='hu' checked/>.hu</td>
- </tr>
- <tr>
- <td><input type='checkbox' name='eu' checked/>.eu</td>
- </tr>
- </table>
- <table width='60%' border='0'>
- <tr>
- <td><div align='center'><input type='submit' name='beirhat' value='NYOMJAD'></div></td>
- </tr>
- </table>
- </form>");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment