I'm doing this...

$subdomain = $node->field_subdomain[0]['value'];
$cpanel_user = "*****";
$cpanel_password = "******";
$cpanel_host = "******";
$cpanel_skin = "x";
$curl_path = "/usr/bin/curl";

$database = "$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/sql/adddb.html?db=$subdomain'";
$asignuser = "$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/sql/addusertodb.html?user=$cpanel_user_$cpanel_user&db=$cpanel_user_$subdomain&SELECT=SELECT&CREATE=CREATE&INSERT=INSERT&ALTER=ALTER&UPDATE=UPDATE&DROP=DROP&LOCKTABLES=LOCK&INDEX=INDEX&REFERENCES=REFERENCES&CREATETEMPORARYTABLES=TEMPORARY'";
$subdm = "$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/subdomain/doadddomain.html?domain=$subdomain&rootdomain=example.com'";

drupal_execute($database, $assignuser, $subdm);

I'm not really sure on the drupal_execute part, as I'm trying to still grasp this but i'm getting errors all over the place when I try this and any variation of it.

Is it because the browser is trying to go somewhere else? If so, can I just store this script in a file somewhere? The only problem then is how do I define the $subdomain variable that is passed into the script in another file so it is generated on the fly?

Comments

colan’s picture

Component: Miscellaneous » Code
Status: Active » Closed (won't fix)

Version 5 is no longer supported.