şöyle bir kod kullanmıştım çalışıyor:
<?php
define('CPANELUSER','kadi');
define('CPANELPASS','şifre');
define('INPUT_FILE','domains.txt');
define('CPANEL_SKIN','tema');
define('DOMAIN','site link');
function getVar($name, $def = '') {
if (isset($_REQUEST[$name]) && ($_REQUEST[$name] != ''))
return $_REQUEST[$name];
else
return $def;
}
$cpaneluser=CPANELUSER;
$cpanelpass=CPANELPASS;
$cpanel_skin=CPANEL_SKIN;
if (isset($_REQUEST["subdomain"])) {
$doms = array(DOMAIN. ";" . $_REQUEST["subdomain"]);
}
else {
$doms = @file(INPUT_FILE);
if (!$doms) {
echo "
Cannot find input file with subdomains information. It is ok if you are not creating subdomains from file.<br>
Tip: leave field empty to use default value you have specified in the script's code.<br>
<form method='post'>
Subdomain:<input name='subdomain'><br>
<input type='submit' value='Create Subdomain' style='border:1px solid black'>
</form>";
die();
}
}
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;
}
foreach($doms as $dom) {
$lines = explode(';',$dom);
if (count($lines) == 2) {
// domain and subdomain passed
$domain = trim($lines[0]);
$subd = trim($lines[1]);
}
else {
$domain =DOMAIN;
$subd = trim($lines[0]);
}
$request = "/frontend/$cpanel_skin/subdomain/doadddomain.html?rootdomain=$domain&domain=$subd";
$result = subd('localhost',2082,$cpaneluser,$cpanelpass,$request);
$show = strip_tags($result);
}
?>buda eposta için:
http://www.zubrag.com/scripts/cpanel...il-account.php
hocam kodları incelediğimde subdomain oluşturmak için kullanıyorsunuz sanırım siz bunu ?