Hi,
I have a script (obtained on this forum last year) that adds / deletes POP boxes using PHP. I have added a routine to create a forwarder. However, I cannot get one to work that deletes a forwarder. The code I have is:
I know the URL for the deletion needs to be /frontend/$cpaneltheme/mail/dodelfwd.html?email=spam@mydomain.co.uk=forwarded address but can't get it to work. I have tried various ways of getting the $email to concatenate into the required string, but all fail. Any ideas? I think it's the second '= in the query string causing the issue, but can't remember how to avoid this.Code:deletefwd('spam@mydomain.co.uk','forwarded address') */ function deletefwd($email,$forwarded) { $email=$email . "=" . $forwarded; global $cpaneltheme,$cpanelpass,$cpaneluser,$host; $request_url="/frontend/$cpaneltheme/mail/dodelfwd.html?email=$email"; $socket = fsockopen($host,2082,$errno,$errstr); if (!$socket) { echo "$errstr ($errno)<br />\n"; } $authstr = "$cpaneluser:$cpanelpass"; $pass = base64_encode($authstr); $in = "GET $request_url\r\n HTTP/1.0\r\nAuthorization: Basic $pass \r\n". "Connection: Close\r\n" . "\r\n"; fputs($socket,$in); $result_from_action=""; // for debug while (!feof($socket)) { $result_from_action.=fgets($socket, 128); } fclose($socket); }
Thanks


LinkBack URL
About LinkBacks
Reply With Quote