Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > ผมโหลดไฟล์สคริปท์ PHP มาแก้เพื่อทำระบบ Whois ไม่รู้ว่าติดตรงไนรบกวนท่านผู้รู้ช่วยดูหน่อยครับ



 

ผมโหลดไฟล์สคริปท์ PHP มาแก้เพื่อทำระบบ Whois ไม่รู้ว่าติดตรงไนรบกวนท่านผู้รู้ช่วยดูหน่อยครับ

 



Topic : 082749



โพสกระทู้ ( 1 )
บทความ ( 0 )



สถานะออฟไลน์




ผมโหลดไฟล์สคริปท์ PHP มาแก้เพื่อทำระบบ Whois
แต่พอเพิ่มการตรวจสอบ .th เข้าไปปรากฎว่ามันไม่ตรวจครับ

ไม่รู้ว่าติดตรงไนรบกวนท่านผู้รู้ช่วยดูหน่อยครับ


Code (PHP)
<?php
/*************************************************
 * Max's Whois
 *
 * Version: 1.0
 * Date: 2007-11-28
 *
 ****************************************************/

/*----------------------------------------------------------------------
#Youjoomla YJ Whois v1.0
# ----------------------------------------------------------------------
# Modified by: You Joomla
# License: GNU GPL
# Website: http://www.youjoomla.com
------------------------------------------------------------------------*/

  defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.');
echo "<!-- http://www.Youjoomla.com  YJ Whois v1.0 for Joomla 1.5 starts here -->	";




 



class maxWhois{

    var $serverList;
    var $tr = 0;
   
function maxWhois(){   
    $this->serverList[0]['top']      = 'com';
	$this->serverList[0]['server']   = 'whois.crsnic.net';
	$this->serverList[0]['response'] = 'No match for';
	$this->serverList[0]['check']    = false;
	
	$this->serverList[1]['top']      = 'net';
	$this->serverList[1]['server']   = 'whois.crsnic.net';
	$this->serverList[1]['response'] = 'No match for';
	$this->serverList[1]['check']    = false;

	$this->serverList[2]['top']      = 'org';
	$this->serverList[2]['server']   = 'whois.publicinterestregistry.net';
	$this->serverList[2]['response'] = 'NOT FOUND';
	$this->serverList[2]['check']    = false;


	$this->serverList[3]['top']      = 'ac.th';
	$this->serverList[3]['server']   = 'whois.thnic.co.th';
	$this->serverList[3]['response'] = 'No match for';
	$this->serverList[3]['check']    = false;


	$this->serverList[4]['top']      = 'go.th';
	$this->serverList[4]['server']   = 'whois.thnic.co.th';
	$this->serverList[4]['response'] = 'No match for';
	$this->serverList[4]['check']    = false;


	$this->serverList[5]['top']      = 'co.th';
	$this->serverList[5]['server']   = 'whois.thnic.co.th';
	$this->serverList[5]['response'] = 'No match for';
	$this->serverList[5]['check']    = false;

	$this->serverList[6]['top']      = 'in.th';
	$this->serverList[6]['server']   = 'whois.thnic.co.th';
	$this->serverList[6]['response'] = 'No match for';
	$this->serverList[6]['check']    = false;


	$this->serverList[7]['top']      = 'or.th';
	$this->serverList[7]['server']   = 'whois.thnic.co.th';
	$this->serverList[7]['response'] = 'No match for';
	$this->serverList[7]['check']    = false;

    $this->serverList[8]['top']      = 'mi.th';
    $this->serverList[8]['server']   = 'whois.thnic.co.th';
    $this->serverList[8]['response'] = 'No match for';
    $this->serverList[8]['check']    = false;
}

function showHeader(){
?>
 
 

        
       <?php
	   // -- figure out what URL to use for prefix
// -- Loop through existing prefix to get all of the variables

function getCurrentURL_whois(){
$cururl_whois = JRequest::getURI();
if(($pos = strpos($cururl_whois, "index.php"))!== false){
$cururl_whois = substr($cururl_whois,$pos);
}
$cururl_whois = JRoute::_($cururl_whois);
return $cururl_whois;
}
	   
	   
	   ?>
  
<?php
}

function showWhoisForm(){
?>
            <form action="<?php echo getCurrentURL_whois(); ?>" method="post" >






				<br>
               <left><font color='#009900'><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;กรุณาทำการตรวจสอบชื่อโดเมนเนมที่ท่านต้องการจะจดทะเบียนก่อนครับ<b></font><br></left>
			   <left>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>www.</b><input name="domain" type="text" size="35" />

			   <?php
					$i = 0;





					foreach ($this->serverList as $value) {
					if ($value['check'] == true) $checked='checked="checked"';
					else $checked = '';

					echo '<input type="checkbox" name="top_'.$value['top'].'" '.$checked.'/>.'.$value['top'].'';
					$i++;            		
            		if ($i > 4) {
            		    $i = 0;
					}
					
					
					
					
					
					
					
            	}

            ?>
			&nbsp;&nbsp;<input type="submit" class="button" name="submitBtn"  value="ตรวจสอบ" />
			</left><br><br><br>
				
  
  </form>
<?php
}

function showFooter(){
?>
        

<?php

}

function processWhois($params){
    $this->showHeader();

    if (!isset($_POST['submitBtn'])){
        $this->showWhoisForm();
    } else {

         $domainName = (isset($_POST['domain'])) ? htmlspecialchars(strip_tags($_POST['domain'])) : '';
        
       	for ($i = 0; $i < sizeof($this->serverList); $i++) {
       		$actTop = "top_".$this->serverList[$i]['top'];
       		$this->serverList[$i]['check'] = isset($_POST[$actTop]) ? true : false;
       	}

        // Check domains only if the base name is big enough
        if (strlen($domainName)>2){
            echo '<table class="dtable">';
            echo '<tr><th colspan="2"></th></tr>';
		
           	for ($i = 0; $i < sizeof($this->serverList); $i++) {
	       		if ($this->serverList[$i]['check']){
			     	$this->showDomainResult($params,$domainName.".".$this->serverList[$i]['top'],
			     	                        $this->serverList[$i]['server'],
			     	                        $this->serverList[$i]['response']);
			    }
		    }
        
		    echo '</table>';
        }
        $this->showWhoisForm();
        
    }
    $this->showFooter();

}

function showDomainResult($params,$domain,$server,$findText){
 $your_link=$params->get('your_link','icteasy.com');


   if ($this->tr == 0){
       $this->tr = 1;
       $class = " class='tr2'";
	  
   } else {
       $this->tr = 0;
       $class = "";
	   
   }
   if ($this->checkDomain($domain,$server,$findText)){

     



       //$register = 'icteasy.com';
      echo "<tr $class><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#FF0000'>$domain</font></td><td class='ava'><font color='#009900'>&nbsp;&nbsp;&nbsp;<img src='modules/mod_yj_whois/images/available.png' width='16' height='16' align='top' alt='available' />&nbsp;<b>ว่าง</b> สามารถนำชื่อนี้ไปจดโดเมนในแบบฟอร์มด้านล่างได้เลยครับ</font></td></tr>";
   }
else echo  "<tr $class><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#FF0000'>$domain</font></td><td class='ava'><font color='#FF0000'>&nbsp;&nbsp;&nbsp;<img src='modules/mod_yj_whois/images/taken.png' width='16' height='16' alt='not available' align='top'/>&nbsp; มีผู้จดทะเบียนใช้งานแล้ว กรุณาเลือกชื่อใหม่ครับ:&nbsp;&nbsp;&nbsp; </font><a href ='http://www.$domain' target='blank'><b>ไปยังเว็บไซต์ $domain</b></a></td></tr>";}




function checkDomain($domain,$server,$findText){
    $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;   
    }
}

}
?>
<?php
	$whois = new maxWhois();

    $whois->processWhois($params);
	

?>




Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-08-22 15:47:48 By : borntobit View : 909 Reply : 1
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

กระทู้นี้เห็นเขียนแจกไว้น่ะครับ

Go to : เรื่อง code check domain ครับ มีปัญหาตรงพวกดอทในประเทศไทยอ่ะครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-08-22 17:33:15 By : mr.win
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ผมโหลดไฟล์สคริปท์ PHP มาแก้เพื่อทำระบบ Whois ไม่รู้ว่าติดตรงไนรบกวนท่านผู้รู้ช่วยดูหน่อยครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 00
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่