The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Password Change

Discussion in 'E-mail Discussions' started by marbles1704, Oct 7, 2010.

  1. marbles1704

    marbles1704 Member

    Joined:
    Jan 15, 2006
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    Is there a way to allow users to change their passwords without logging in to cpanel. I found something on google but not working ..


    PHP:
    <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>
     
  2. marbles1704

    marbles1704 Member

    Joined:
    Jan 15, 2006
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    checked everything ok .. but still not working :(
     
Loading...

Share This Page