title: subdomain creation problem dynamically in php
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5046575/problems-in-dynamic-craetion-of-subdomains-in-php">problems in dynamic craetion of subdomains in php</a>  </p>
  </blockquote>
  
  
  
  <p>Hi,
  I have below code which was working fine on testing server but when i transfer it to iPage server my subdomain is not being create. I m not finding where is coming from .Plz take a look.</p>
  
  <pre><code>function subd($host,$port,$ownername,$passw,$request) {
  
    //$sock = fsockopen('localhost',2082);
    $sock = fsockopen("www.mydomain.com", 80, $errno, $errstr, 30);
    echo $sock;
  
    if(!$sock) {
      print('Socket error');
      exit();
    }
  
    $authstr = "$ownername:$passw";
    $pass = base64_encode($authstr); 
  
    $in = "GET $request\r\n";
    $in .= "HTTP/1.0\r\n";
    $in .= "Host:$host\r\n";
    $in .= "Authorization: Basic $pass\r\n";
    $in .= "\r\n";
  
    fputs($sock, $in);
  
    while (!feof($sock)) {
      $result .= fgets ($sock,128);
    }
  
    fclose( $sock );
    return $result;
  }
  $domain='mydomain.com';
  
  $subd="f1f1f1f1";
  
  $request = "/frontend/$cpanel_skin/subdomain/doadddomain.html?rootdomain=$domain&amp;domain=$subd";
  </code></pre>
  
  <p>Password and userid is with my code. I m not getting any error.When i m echoing this is printing "Resource id #1 " nearby socket printing ($sock).</p>