problems in dynamic craetion of subdomains in php
<p>Hello
I am creating subdomains in php by the following code.</p>

<pre><code>function subd($host,$port,$ownername,$passw,$request) {


  $sock = fsockopen('localhost',2082);

  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="memories.mydomain.com";

        $subd="abcdef";

        $request ="frontend/x3/subdomain/doadddomain.html?domain=$subd&amp;rootdomain=$domain&amp;dir=public_html/$subd&amp;go=Create";

        $host="ftp.mydomain.com";

        $port="2083";

        $ownername="ownername";

        $passw="my_PASSWORD";

        $result=subd($host,$port,$ownername,$passw,$request);

        $show = strip_tags($result);


    $d="http://$subdomainname.$domain";


          echo '&lt;META HTTP-EQUIV="Refresh" Content="0; URL='.$d.'"&gt;';
</code></pre>

<p>I am seeing in my cpanel sub-domain is creating but i want to redirect to my sob-domains when creation completed but instead of subdomain i am redirecting to  error page which is
<a href="http://abcdef.memories.mydomain.com/cgi-sys/defaultwebpage.cgi" rel="nofollow">http://abcdef.memories.mydomain.com/cgi-sys/defaultwebpage.cgi</a>. What is the problem behind it.Why am i redirecting to unsupported link.?
Thanks</p>
