I took a look at the cPanel forums and found this that might help you.
CODE
<?php
// This script will add a subdomain and ftp account
// Just change $login, $pass, and $domain - You shouldn't have to touch
// anything else (unless you want to change how it looks)
if (isset($create)) {
$login = "cpanellogin";
$pass = "cpanelpass";
$domain = "domainname.com";
$output = fopen ("http://$login:$pass@www.$domain:2082/frontend/x/subdomain/doad
ddomain.html?domain=$subdomain&rootdomain=$domain", "r");
$output = fopen ("http://$login:$pass@www.$domain:2082/frontend/x/ftp/doaddftp.h
tml?login=$subdomain&password=$ftppass&homedir=$subdomain", "r");
print ("Subdomain Created.<br>\n");
print ("You can now access it at <a href=\"http://$subdomain.$domain\">http://$s
ubdomain.$domain</a><br>\n");
print ("You also have ftp access. Log in at <a href=\"ftp://ftp.$domain\">ftp://
ftp.$domain</a> with the username $subdomain@$domain and the password $ftppass\n")
;
} else {
?>
<html>
<head>
<title>Automatic Subdomain Creator</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form method="post" action="<?php print($_SERVER['PHP_SELF']); ?>">
Subdomain: <input name="subdomain" type="text"><br>
Password: <input name="ftppass" type="password"><br>
<input name="create" type=submit value="Create">
</form>
<?php
}
?>