problems in dynamic craetion of subdomains in php -
hello creating subdomains in php following 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&rootdomain=$domain&dir=public_html/$subd&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 '<meta http-equiv="refresh" content="0; url='.$d.'">';
i seeing in cpanel sub-domain creating want redirect sob-domains when creation completed instead of subdomain redirecting error page http://abcdef.memories.mydomain.com/cgi-sys/defaultwebpage.cgi. problem behind it.why redirecting unsupported link.? thanks
wow, you're writing automated front end automated front end. why don't create subdomain directly in php script, , skip messing around cpanel?
Comments
Post a Comment