The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

error deleting account

Discussion in 'General Discussion' started by kgp43, Feb 25, 2005.

  1. kgp43

    kgp43 Active Member

    Joined:
    Aug 25, 2004
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    Im using Remote Access Key to delete domains stored in my database from the server.
    My code work the way it delete the domain from the server and afterwards remove the entry from my database.

    The problem is, sometime it post a error instead of deleting the domain from the server (30-40% or so) and afterwards delete the entry in my database.

    Is there a way to fix this error or atleast stop the script if the remote-access-key fail?
    ex.:

    if($killuser = error) {
    exit();
    }

    This is the error I receive:
    Warning: socket_connect() Host lookup failed [-10004]: No address associated with name in /usr/local/cpanel/Cpanel/Accounting.php.inc on line 102

    - Sometime I can upload the domain details to the database and Remote Access Key delete the domain.


    This is some of my code:

    Code:
    $host = $server_fetch[serverip];
    $user = "root";
    
    //Require the needed functions
    require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
    
    //Deleting the account from server
    $killuser = killacct($host,$user,$accesshash,$usessl,$domain_username);
    
    //Delete domain from the database
    mysql_query("DELETE FROM domains WHERE id='$domain_id' AND userid='$userid' LIMIT 1 ");
    

    Realy wish someone chould help me with this.
     
  2. kgp43

    kgp43 Active Member

    Joined:
    Aug 25, 2004
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    found a solution:

    //Check if the deletion of the account fail
    If ($killuser == false) {

    //Disable error reporting
    error_reporting(0);

    echo "error";

    //Enable error reporting
    error_reporting(1);
    exit();
    }
     
Loading...

Share This Page