[REQ] Password Change PHP Script [REQ] menu

User Tag List

Results 1 to 5 of 5
  1. #1
    GraziServers's Avatar Member
    Reputation
    13
    Join Date
    Jul 2008
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [REQ] Password Change PHP Script [REQ]

    Title says it all.

    I need a PHP script that will allow users to change their password

    I've seen them before but any download links are dead.

    will rep

    [REQ] Password Change PHP Script [REQ]
  2. #2
    Choices's Avatar Member
    Reputation
    94
    Join Date
    Apr 2008
    Posts
    231
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something by Bellatrix

    Code:
    <?php
    
    /*
    Feel free to alter or change the layout in any manner you see fit.
    I'd appreciate it if you left the 'Made by Bellatrix' line though.
    */
    echo "<link href='style.css' type='text/css' rel='stylesheet'>"; 
    echo "<html><body>";
    echo "<center><table>";
    echo "<tr><td colspan=2 align=center><img src='../images/changepass.jpg'></td></tr>";
    
    include_once "./config/configc.php";
    global $aHost, $aDatabase, $aPort, $aUsername, $aPass, $cHost, $cDatabase, $cPort, $cUsername, $cPass;
    
    function shitChecker($str)
    {
        $var = preg_match('/[^a-zA-Z]/', $str);
        return $var;
    }
    function shitCheckerNum($str)
    {
      $var = preg_match('/[^a-zA-Z0-9]/', $str);
      return $var;
    }
    
    if(isset($_POST['submit']))
    {
        //Get all the user inputs
        $account = $_POST['account'];
        $passwordOld = $_POST['passwordOld'];
        $passwordNew = $_POST['passwordNew'];
        $passwordNew1 = $_POST['passwordNew1'];
    
        //Connect to accounts database
        $con = mysql_connect($aHost.":".$aPort, $aUsername, $aPass) or die(mysql_error());
        mysql_select_db($aDatabase) or die(mysql_error());
    
        //Remove bullshit from the user inputs(Sorta pointless as i use regex in a second...
        $account = mysql_real_escape_string(html_entity_decode(htmlentities($account)));
        $passwordOld = mysql_real_escape_string(html_entity_decode(htmlentities($passwordOld)));
        $passwordNew = mysql_real_escape_string(html_entity_decode(htmlentities($passwordNew)));
        $passwordNew1 = mysql_real_escape_string(html_entity_decode(htmlentities($passwordNew1)));
    
        //Die if account contains non-alphanumeric characters
        if(shitCheckerNum($account) == 1)
        {
          die("Error: Account contains invalid characters!");
        }
        //Die if old password contains non-alphanumeric characters
        elseif(shitCheckerNum($passwordOld) == 1)
        {
          die("Error: Password contains invalid characters!");
        }
        //Die if new password contains non-alphanumeric characters
        elseif(shitCheckerNum($passwordNew) == 1)
        {
          die("Error: New password contains invalid characters!");
        }
        //Die if new password(confirm) contains non-alphanumeric characters
        elseif(shitCheckerNum($passwordNew1) == 1)
        {
          die("Error: New password contains invalid characters!");
        }
    
        //If new pass and new pass(confirm) dont match, die.
        if($passwordNew != $passwordNew1)
        {
            die("New password fields must match!");
        }
    
        //Get acct num from db
        $query = "SELECT acct FROM accounts WHERE login = '".$account."' AND password = '".$passwordOld."'";
    
        $result = mysql_query($query) or die(mysql_error());
        $numrows = mysql_num_rows($result);
    
        echo "<tr><td align=center>";
    
        //If no rows, means invalid user/pass, die.
        if($numrows == 0)
        {
            die("Invalid username/password!");
        }
    
        //Change pass to new password
        $query = "UPDATE accounts SET password = '".$passwordNew."' WHERE login = '".$account."'";
        $result = mysql_query($query) or die(mysql_error());
    
        echo "Password for account '".$account."' successfully changed!";
    
        echo "</td></tr>";
    
        //close mysql connection
        mysql_close();
    }
    else
    {
        echo "<form name=myform method=post action=passchanger.php>";
        echo "<tr><td colspan=2 align=center><font size=4>Change Account Password</td></tr>";
        echo "<tr><td width=125>Account Name: </td><td><input type=text name=account value=''></td></tr>";
        echo "<tr><td width=125>Old-Password: </td><td><input type=password name=passwordOld value=''></td></tr>";
        echo "<tr><td width=125>New-Password: </td><td><input type=password name=passwordNew value=''></td></tr>";
        echo "<tr><td width=125>Re-Enter: </td><td><input type=password name=passwordNew1 value=''></td></tr>";
        echo "<tr><td colspan=2 align=center><br><input type=submit name=submit value=Submit></td></tr>";
        echo "</form>";
    }
    
    echo "</table></center>";
    echo "Made by Bellatrix";
    echo "<br>You MUST be offline to use this!";
    ?>

  3. #3
    Sebastian011's Avatar Member
    Reputation
    22
    Join Date
    Jan 2009
    Posts
    112
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by GraziServers View Post
    Title says it all.

    I need a PHP script that will allow users to change their password

    I've seen them before but any download links are dead.

    will rep
    If you give the players normal accses ro commands they can:

    Se what account lvl their account is (0)
    .start (unstuck)
    .info (gives info about server)
    .gm (show gm's online + their tag <AZ or ADMIN>)
    .password (this will let you change your password!)

    and smoe others, none of the are usefull really

  4. #4
    Bunster's Avatar Active Member
    Reputation
    19
    Join Date
    May 2008
    Posts
    553
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Sebastian011 View Post
    If you give the players normal accses ro commands they can:

    Se what account lvl their account is (0)
    .start (unstuck)
    .info (gives info about server)
    .gm (show gm's online + their tag <AZ or ADMIN>)
    .password (this will let you change your password!)

    and smoe others, none of the are usefull really
    Seems pretty good, change your own password, but yeah this i think it all good to use. :P Good Luck

  5. #5
    oliverdk's Avatar Member
    Reputation
    1
    Join Date
    Apr 2008
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Man just wath i need

Similar Threads

  1. Most Popular Password Change Script
    By cnoodle in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 06-05-2009, 09:48 PM
  2. [RELEASE]Web Registration Script(guided), Secured, 4 steps Registration PHP script
    By Viking.nor in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 07-31-2008, 03:59 AM
  3. PVP RANKINGS [php] script?
    By Algorithm in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 05-16-2008, 12:31 PM
All times are GMT -5. The time now is 01:58 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search