We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25551 ☆ A M B ☆
    • 1,231 Posts
    I’m a total novice with php etc so I really have no idea. The script was able to be run properly with my host and searched for available domains correctly. All I need to do is integrate it in to modx so i don’t have it appearing in a page on it’s own.
      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
      AugmentBLU - MODX Partner

      BLUcart - MODX Revolution E-Commerce & Shopping Cart
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      This could be easily enough made into an AJAX application http://www.phpwhois.org/

      It directly queries the specified server using sockets.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 37550 ☆ A M B ☆
        • 711 Posts
        Hows about this: http://modxtest.onesmarthost.co.uk/index.php?id=66

        Btw this is my new site design im launching today laugh

          http://www.onesmarthost.co.uk
          UK MODX Hosting with love.
          • 25551 ☆ A M B ☆
          • 1,231 Posts
          Quote from: awardle at Mar 15, 2008, 11:27 AM

          Hows about this: http://modxtest.onesmarthost.co.uk/index.php?id=66

          Btw this is my new site design im launching today laugh



          Looks nice.... especially the domain search script! It’s the same one I upped LOL! Now you gonna be nice and share how you made the snippet? LOL
            Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
            AugmentBLU - MODX Partner

            BLUcart - MODX Revolution E-Commerce & Shopping Cart
            • 37550 ☆ A M B ☆
            • 711 Posts
            Yep certainly I just need to tidy up what I did as I kind of rushed to get it working and then I will post the details on how it can be done on here shortly.

            I used the zip you posted on here, Its a nice AJAX script I will most likely rip it apart at some point and get it to use ENOM API which is a lot quicker and reliable.

            Aaron
              http://www.onesmarthost.co.uk
              UK MODX Hosting with love.
              • 37550 ☆ A M B ☆
              • 711 Posts
              OK Here goes:

              Attached is a modified zip of the ajaxwhois script you posted.

              Upload the folder "ajaxwhois" to /assets/snippets/

              I had to modify these files to set the correct paths to images (you will not need to do this as I have done it).

              AjaxWhois.php, js\mootools.js

              In the zip folder you will see 3 txt files

              1) in modx create a new snippet called: ajaxwhois and copy the contents of snippet-ajaxwhois.txt into it
              2) in modx create a new snippet called: whoistlds and copy the contents of snippet-whoistlds.txt into it
              3) Create a new page in modx set the template to be used to none, hide it in the menu, turn of cachable and call it something like whois
              then enter this into the page content


              [!ajaxwhois!]

              Once you save this make a note of the page ID (the ajax search calls this page in the background to get the results)

              4) Create a new page for the domain search form

              Paste in the contents of searchpage.txt

              now you will need to modify one line in here to point the form to the whois page which you created above

              look for:


              <form id="whois" action="[~73~]" method="post" >

              change the 73 to the ID you captured above and save the page

              -----

              It should now work in MODx for you.

              Aaron


                http://www.onesmarthost.co.uk
                UK MODX Hosting with love.
                • 25551 ☆ A M B ☆
                • 1,231 Posts
                Hey, thanks for that. Works perfectly.... nearly. When I click the whois link after domain names are found to be taken, a box pops up saying there was a problem with my request. I’ll check over what i put again. I wouldn’t of worked out how to get that working how you did so thanks for the help.
                  Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                  AugmentBLU - MODX Partner

                  BLUcart - MODX Revolution E-Commerce & Shopping Cart
                  • 37550 ☆ A M B ☆
                  • 711 Posts
                  Glad to hear you have it working well most of it, I’ve just looked at the whois part and heres what you need to do:

                  Create a new page in MODx called getwhois - set this with a blank template, not cached, not in the menu and published

                  In the content put

                  [!getwhois!]

                  Save the page and make a note of the ID number or if you use friendly urls you can just use getwhois.html

                  Edit this file assets/snippets/ajaxwhois/AjaxWhois.php

                  Look for a reference "get.php" replace this with the full path to your server i.e. mine was http://www.domainname.com/getwhois.html or http://www.domainname.com/index.php?id=77

                  Now create a snippet called "getwhois" and paste the contents of this in it:


                  <?php
                  /*************************************************
                  * SOFT64 PhpAjaxWhois
                  *
                  * Version: 1.1
                  * Date: 1/29/2008
                  *
                  ****************************************************/

                  require_once("assets/snippets/ajaxwhois/AjaxWhois.php");
                  $whois = new AjaxWhois();

                  $output = ’<fieldset><legend class="green">Whois results</legend><div align="left">’;

                  // always scour user input
                  $domain=escapeshellcmd($_GET[’domain’]);

                  // path to whois
                  $cmd="/usr/bin/whois $domain";

                  exec($cmd,$data);
                  $max=count($data);
                  $count=0;

                  if($max):
                  while($count <= $max):
                  $output .= "$data[$count]
                  ";
                  // check each line returned for the whois server for the domain
                  if(ereg("Whois Server: ", $data[$count])):
                  $whoserver=ereg_replace("Whois Server: ", "", $data[$count]);
                  endif;
                  $count++;
                  endwhile;
                  endif;
                  if(isset($whoserver)):
                  $cmd="/usr/local/php/bin/whois -h$whoserver $domain";
                  unset($data);
                  exec($cmd,$data);
                  $max=count($data);
                  $count=0;
                  if($max):
                  while($count <= $max):
                  $output .= "$data[$count]
                  ";
                  $count++;
                  endwhile;
                  endif;
                  endif;
                  $output .= ’</div></fieldset>’;

                  return $output;
                  ?>

                  This will only work on a linux machine as Ive tried it on mine and php command functions are disabled, however if you are on windows I will soon have an Enom API version smiley

                  Aaron.
                    http://www.onesmarthost.co.uk
                    UK MODX Hosting with love.
                    • 25551 ☆ A M B ☆
                    • 1,231 Posts
                    I’m either doing something wrong or it’s me doing something really wrong... i can’t get it to do the whois.

                    I edit the ajaxwhois.php file to

                    class AjaxWhois{

                    var $serverList;
                    var $tr = 0;

                    function CheckWhois($domain){

                    return "
                    <a href=\"#\" onclick=\"javascript:makeRequest(’http://www.rossco-designs.com/index.php?id=39’, ’?domain=$domain’);\">Whois</a>
                    ";

                    }


                    instead of

                    class AjaxWhois{

                    var $serverList;
                    var $tr = 0;

                    function CheckWhois($domain){

                    return "
                    <a href=\"#\" onclick=\"javascript:makeRequest(’get.php’, ’?domain=$domain’);\">Whois</a>
                    ";

                    }


                    is this correct?
                      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                      AugmentBLU - MODX Partner

                      BLUcart - MODX Revolution E-Commerce & Shopping Cart
                      • 37550 ☆ A M B ☆
                      • 711 Posts
                      Looks good to me, what hosting are you on? also does the original script you downloaded work outside of modx for whois lookups? a lot of web hosts might block this.
                        http://www.onesmarthost.co.uk
                        UK MODX Hosting with love.