Hi all i am working on some code i have had some help with the code and no go.
here is my code.
<?php
$quota = 20;
$newpop = "ggggggggg";
$newpassword = "gggggggg";
$domain = "psbangkok.com";
$request ="/frontend/orbit/mail/doaddpop.html?quota=$quota&email=$newpop&domain=$domain&password=$newpassword";
$host = "host3.miwebdns3.com";
$port = 2083;
$ownername = "wwnersname";
$reseller_pass = "Password";
function addpopemail($host,$port,$ownername,$reseller_pass,$request)
{
global $email,$password;
$sock = fsockopen($host,$port);
if(!$sock)
{
print('Socket error');
exit();
}
$authstr = $ownername.":".$reseller_pass;
$pass = base64_encode($authstr);
$in .= "GET $request\r\n";
$in .= "HTTP/1.0\r\n";
$in .= "Host:$domain\r\n";
$in .= "Authorization: Basic $pass\r\n";
$in .= "\r\n";
fputs($sock, $in);
while (!feof($sock)) {
fgets ($sock,128);
$result .= fgets ($sock,128);
}
fclose( $sock );
return $result;
}
addpopemail($host,$port,$ownername,$reseller_pass,$request);
echo"$host";
echo"$request";
?>
Now when I run it i see this
host3.miwebdns3.com/frontend/orbit/mail/doaddpop.html?quota=20&email=ggggggggg&domain=psbangkok.com&password=gggggggg
The code seems to be building the string properly but will not create the actual email in the cpanel.
Now if i am loged into cpanel and i copy and past everything after /frontend and put it in a browser and press go then it will create the ggggggg emil in the cpanel. Any thoughts here will be appreciated.
Thanks all for reading.
Grant