Archive for February, 2007

Teruntuk Istri Calon Istri Saya

Saturday, February 24th, 2007

Udah lulus ujian akhir yah sayang. Selamat ya. Ditunggu traktiran makan-makannya.. *mumpung masih calon, jadi bisa minta traktir* hihi.

Curl, ccTLD .id

Wednesday, February 21st, 2007

Last Night, My script didn't work well while contacting register.net.id's whois port.

PORT STATE SERVICE
43/tcp closed whois

Yeah, it's closed. So, i write a code to check domain availability through the-must-opened port ( http!!) Using PHP + libcurl. :D

PHP:
  1. <?
  2. $available = "Domain Belum Terdaftar";
  3. $navigation = 'domain'; //form jack!
  4. $keyword = 'amikom'; //nama domain
  5. $domain_category  = 'ac.id'; // ccTLD
  6. $curlPost = 'navigation='  . urlencode($navigation) . '&keyword=' . urlencode($keyword) . '&domain_category=' . urlencode($domain_category) . '&go=Check';
  7. $ch = curl_init();
  8. curl_setopt($ch, CURLOPT_URL, 'http://register.net.id/whois');
  9. curl_setopt($ch, CURLOPT_HEADER, 1);
  10. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  11. curl_setopt($ch, CURLOPT_POST, 1);
  12. curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
  13. $data = curl_exec($ch);
  14. $cek = eregi($available,$data);
  15. if($cek == true){
  16.     echo "Domain masih available";
  17. } else {
  18.     echo "Domain tidak available";
  19. }
  20. curl_close($ch);
  21. ?>

Thanks to Sandal for nmap information.