Hi,
I have been looking on the net for a few days now for a working 'doaddpop' script so i can automate the setup of accounts on my server!
After trying them all i found one!
Here it is!
I hope this helps anyone who wants it.
I thought it would be bad not to post it up for people.
Jamie.
I have been looking on the net for a few days now for a working 'doaddpop' script so i can automate the setup of accounts on my server!
After trying them all i found one!
Here it is!
PHP:
$u = "cpanelUsername"; //your cpanel username
$p = "cpanelPassword"; //your cpanel password
$domain = "domain.com"; // Your Domain without the http or www.
// Variables from signup form.
$username = $_POST['username'];
$password = $_POST['password'];
// QUOTA IS SET TO 100 IN THIS SCRIPT, change it to whatever you like.
// Register POP Account on cPanel.
$file = fopen("http://$u:$p@$domain:2082/frontend/x/mail/doaddpop.html?email=$username&domain=$domain&password=$password"a=100", "r");
if (!$file)
{
echo "<p>Unable to open remote file.\n";
exit;
} // Unable to connect.
while (!feof ($file))
{
$line = fgets ($file, 1024);
if(eregi("already exists!", $line, $out))
{
echo "That name is in use. Please Try Another name.";
exit;
} // If name exists.
} // While.
fclose($file);
echo "Email account created!";
I hope this helps anyone who wants it.
I thought it would be bad not to post it up for people.
Jamie.