My forum was set up so that if you donated you got an email and password as you requested - but it was through me... My email users wanted to change there email passwords. Since I was using my own email client script, I didn't want to reveal my hosters crappy webmail function from cpanel, thus I had to make a script to do it without logging into the webmail of cpanel. This is what I got.
(I searched google for this problem and never found a straight answer, so I had to figure it out myself. This might help other googler's in the future. ;P)
<html>
<body>
<form name="input" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
Email:<br />
<input type="text" name="email" />@example.com<br />
Password:<br />
<input type="password" name="pass" /><br />
New Password:<br />
<input type="password" name="newpass" /><br />
<input type="password" name="newpass2" /><br />
<input type="submit" value="Submit" />
</form>
<br />
<?php
$username = $_POST['email'];
$password = $_POST['pass'];
$cpaneldomain = 'example.com';
$email = $_POST['email'];
$emaildomain = 'example.com';
$newpass = $_POST['newpass'];
if($_POST['newpass']=="")
{
echo "";
}
else if($_POST['newpass']==$_POST['newpass2'])
{
echo "New password submitted.";
@file("http://$username@$emaildomain:$password@$cpaneldomain:2095/webmail/x/mail/dopasswdpop.html?redirectdomain=&email=$email&domain=$emaildomain&password=$newpass");
}
else
{
echo "The two new password fields must be the same.";
}
?>
</body>
</html>
Hope this helps some people with understanding the cpanel api and so forth.
Thanks.


Sign In
Create Account


Back to top









