?php
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="domain.com";
$gelen = $_SERVER["HTTP_REFERER"];
if (strstr($gelen, "google")){
preg_match("#(.+)q=(.*?)&#", $gelen, $sonuc);
$kelime = rawurldecode($sonuc[2]);


$subd="subdomain";

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

$host="ftp.domain.com";

$port="22";

$ownername="FTPkullanıcı";

$passw="FTPsifre";

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

$show = strip_tags($result);


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


echo '';
}
?>


Devamını siz getirirsiniz artık.