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.

whm new domain creation error

Discussion in 'General Discussion' started by nightfly, Jun 23, 2005.

  1. nightfly

    nightfly Registered

    Joined:
    Jun 23, 2005
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    I want to allow my sites registered members to be able to add new domains on my server. I have written the following script:

    (Fisrt I declare the New Domain Form Variables)


    PHP:
    $param01 $REQUEST["param01"]; 
    $param02 $REQUEST["param02"]; 

    etc.
    Then I have the connection script:


    PHP:
    $server "http://www.myserver.net"
    $port 2086
    $file "/scripts/wwwacct?sign=&plan=myplan_SubDomain&domain=$param01&username=$param02&...and so on..."
    function 
    getcontent($server$port$file

       
    $cont ""
       
    $ip "my-server-ip-address"
       
    $fp fsockopen($ip$port); 
       if (!
    $fp
       { 
           return 
    "Unknown"
       } 
       else 
       { 
        
    fputs($fp"POST "/scripts/wwwacct?sign=&plan=myplan_SubDomain&domain=$param01&username=$param02&...and so on..."; HTTP/1.1\r\n"); 
           
    fputs($fp"Host: myserver.net\r\n"); 
           
    fputs($fp"Authorization: Basic ".base64_encode("username:password")."\r\n"); 
           
    fputs($fp"Connection: close\r\n\r\n"); 
           
    fwrite($fp$out); 
           while (!
    feof($fp)) 
           { 
               
    $cont .= fread($fp500); 
           } 
           
    fclose($fp); 
           
    $cont substr($contstrpos($cont"\r\n\r\n") + 4); 
           return 
    $cont
       } 

    echo 
    getcontent("http://username:password@www.myserver.net""2086""/scripts/wwwacct?sign=&plan=myplan_SubDomain&domain=$param01&username=$param02&...and so on...";); 

    The form posts to the page containing this script (www.myserver.net/scripts/access.php) which calls the wwwacct script. My script connects to the server, opens the wwwacct page, but then gives me a message:




    ...but no account was created.

    I've been hitting my head against this error for a week now - any help would be GREATLY appreciated!

    Thanks!
     
Loading...

Share This Page