I had to revisit the issue of POSTing to ACP for account changes in order to write a cron job that would log users out at the end of their scheduled time. I have come up with a solution that is completely PHP - no Javascript at all. (this could be done in ASP, Python, or any other language commonly used for building web pages.

The trick? Use fopen to open the ACP admin interface with the POST data, and then capture the response.

Here is the critical function:

function sendPOST($postArray) {
$postData = http_build_query($postArray);
$url = "http://remoteadmin:remotepass@my.web.site/ac/aaccountctrl.asp";
$params = array('http' => array('method' => 'POST','content' => $postData));
$ctx = stream_context_create($params);
$fp = @fopen($url, 'rb', false, $ctx);
$response = @stream_get_contents($fp);
//Log response, or display to user.

The function can be called after setting up the array of POST data:

$postData = array ('op' => $ACP_op, 'nm' => $ACP_name, 'un' => $ACP_username, 'pw' => $ACP_password, 'ci' => $ci, 'wu' => $wu, 'ft' => $ft", 'sx' => $sx, 'ad' => $ad);


Ron Wodaski