Results 1 to 4 of 4
  1. #1

    eNom Domain Spinner

    I am looking for an example script that has made use of the eNom domain spinner. I am not looking for anything fancy, but I would love to see an example since I am not a PHP programmer.

    I have it to a point where it will pull the information, but I don't know how to parse it correctly.
    Code:
    {php}
    include("/home/directory/public_html/libs/enom/EnomInterface_inc.php");
    $Enom = new CEnomInterface;
    $Enom->AddParam( "uid", "username" );
    $Enom->AddParam( "pw", "password" );
    $Enom->AddParam( "command", "namespinner" );
    $Enom->AddParam( "sld", "$sld" );
    $Enom->AddParam( "tld", "&tld" );
    $Enom->AddParam( "ResponceType", "XML" );
    
    $Enom->DoTransaction();
    
    $original = urldecode($Enom->Values['originalsld']);
    echo $original;
    
    $content = urldecode($Enom->Values['spincount']);
    echo $content;
    
    $domain = urldecode($Enom->Values['domain']);
    echo $domain;
    
    $error = urldecode($Enom->Values['Err1']);
    echo $error;
    {/php}
    If anyone can help with this, I will release the code to integrate with WHMCS.

  2. #2
    Join Date
    Feb 2003
    Location
    Connecticut
    Posts
    5,441
    Can you post the output?

  3. #3
    Quote Originally Posted by Dan L View Post
    Can you post the output?
    Sure!

    All it does at this point is display the original domain that was searched - $original = urldecode($Enom->Values['originalsld']);
    echo $original;

    and the number of results that it returned - $content = urldecode($Enom->Values['spincount']);
    echo $content;

    and the error if any - $error = urldecode($Enom->Values['Err1']);
    echo $error;

    I have in the code - $domain = urldecode($Enom->Values['domain']);
    echo $domain;

    but that is not working at all.

    I don't know how to pull the information from the XML file and display it. You can look at the eNom API command catalog from pages 404-407 to see docs and the example XML output.

    I noticed that I edited the script that I used in the first post wrong. It should be
    Code:
    {php}
    include("/home/directory/public_html/libs/enom/EnomInterface_inc.php");
    $Enom = new CEnomInterface;
    $Enom->AddParam( "uid", "username" );
    $Enom->AddParam( "pw", "password" );
    $Enom->AddParam( "command", "namespinner" );
    $Enom->AddParam( "sld", "$sld" );
    $Enom->AddParam( "tld", "$tld" );
    $Enom->AddParam( "ResponceType", "XML" );
    
    $Enom->DoTransaction();
    
    $original = urldecode($Enom->Values['originalsld']);
    echo $original;
    
    $content = urldecode($Enom->Values['spincount']);
    echo $content;
    
    $domain = urldecode($Enom->Values['domain']);
    echo $domain;
    
    $error = urldecode($Enom->Values['Err1']);
    echo $error;
    {/php}
    If you are wanting to use a quick and dirty way of doing this, then use
    Code:
    <?php
    include("/home/directory/public_html/libs/enom/EnomInterface_inc.php");
    $Enom = new CEnomInterface;
    $Enom->AddParam( "uid", "username" );
    $Enom->AddParam( "pw", "password" );
    $Enom->AddParam( "command", "namespinner" );
    $Enom->AddParam( "sld", "$iwanticecream" );
    $Enom->AddParam( "tld", "com" );
    $Enom->AddParam( "ResponceType", "XML" );
    
    $Enom->DoTransaction();
    
    $original = urldecode($Enom->Values['originalsld']);
    echo $original;
    
    $content = urldecode($Enom->Values['spincount']);
    echo $content;
    
    $domain = urldecode($Enom->Values['domain']);
    echo $domain;
    
    $error = urldecode($Enom->Values['Err1']);
    echo $error;
    ?>
    The result will be (if you can get it working) it displaying other suggestions for iwanticecream.com

    Thanks for any help!

  4. #4
    For anyone interested, I have posted the code over at WHMCS.com

    Since I have to few posts, I can't post a clickable URL.

    forum.whmcs.com/showthread.php?t=10047

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •