Creating subdomain using PHP (cpanel environment)

What this snippets do ?
Bypass server cpanel to create each user their subdomain without administrator adding your subdomain manually.

<!--?php
 
// your cPanel username
$cpanel_user = 'username';
 
// your cPanel password
$cpanel_pass = 'password';
 
// your cPanel skin . hover at your cpanel home link button and see the theme name after /frontend/
$cpanel_skin = 'x3';
 
// your cPanel domain
$cpanel_host = 'arif.my';
 
// Replace with your subdomain name e.g: 'blog' for blog.arif.my
$subdomain = 'subdomain';
 
// create the subdomain
 
$sock = fsockopen($cpanel_host,2082);
if(!$sock) {
print('Socket error');
exit();
}
 
$pass = base64_encode("$cpanel_user:$cpanel_pass");
$in = "GET /frontend/$cpanel_skin/subdomain/doadddomain.html?rootdomain=$cpanel_host&amp;domain=$subdomain\r\n";
$in .= "HTTP/1.0\r\n";
$in .= "Host:$cpanel_host\r\n";
$in .= "Authorization: Basic $pass\r\n";
$in .= "\r\n";
 
fputs($sock, $in);
while (!feof($sock)) {
$result .= fgets ($sock,128);
}
fclose($sock);
 
echo $result;
Post comment as twitter logo facebook logo
Sort: Newest | Oldest
ArifSanchez 5 pts

asadudin amin , im testing out this new plugin. tq.