[Help] Change Password Form

Results 1 to 8 of 8
  1. #1
    Enthusiast adiprayitno is offline
    MemberRank
    Jan 2012 Join Date
    30Posts

    [Help] Change Password Form

    Please help me with change password script because mine doesn't work, i'm using 343's registration script with few adding...

    Here my server registration script ;
    PHP Code:
    <html>
    <head>

    <!--    <meta http-equiv="refresh" content="10" > -->
    <script>
    <!--
    function land(ref, target)
    {
    lowtarget=target.toLowerCase();
    if (lowtarget=="_self") {window.location=loc;}
    else {if (lowtarget=="_top") {top.location=loc;}
    else {if (lowtarget=="_blank") {window.open(loc);}
    else {if (lowtarget=="_parent") {parent.location=loc;}
    else {parent.frames[target].location=loc;};
    }}}
    }
    function jump(menu)
    {
    ref=menu.choice.options[menu.choice.selectedIndex].value;
    splitc=ref.lastIndexOf("*");
    target="";
    if (splitc!=-1)
    {loc=ref.substring(0,splitc);
    target=ref.substring(splitc+1,1000);}
    else {loc=ref; target="_self";};
    if (ref != "") {land(loc,target);}
    }
    //-->
    </script>

    <style type="text/css">
    label
    {
    float: left;
    width: 8em;
    margin-right: 0.5em;
    text-align: right;
    display: block;
    }
    </style>

    </head>
    <body style="margin: 0;" bgcolor="#eeeeee">

    <table width="80%" height="25" align="center" cellpadding="10" cellspacing="0" border="1">
    <?
    include "../status.php";
    ?>
    <tr>
        <td align="center" valign="top">
    <font size="+2" color="blue">SIGN - UP</font><br>
        <?
    include "../config.php";

        
    $Data '<form action=index.php method=post>
         <br><br>

    <table width=400 border=0 cellpadding=3 cellspacing=1>
    <tr>
     <td width=257 align=right><font color=black><b> Login ID </b></td>
     <td width=6><font color=black><b>:</b></td>
     <td width=294><input name=login type=text></td>
    </tr>
    <tr>
     <td width=257 align=right><font color=black><b>Password</b></td>
     <td width=6><font color=black><b>:</b></td>
     <td width=294><input name=passwd type=password></td>
    </tr>
    <tr>
     <td width=257 align=right><font color=black><b>Confirm Password</b></td>
     <td width=6><font color=black><b>:</b></td>
     <td width=294><input name=repasswd type=password></td>
    </tr>
    <tr>
     <td width=257 align=right><font color=black><b>Email Address</b></td>
     <td width=6><font color=black><b>:</b></td>
     <td width=294><input name=email type=text></td>
    </tr>
    </table>

    <br>
    <!--    <label><b>User Name:</b></label>
        <input type=text name=login><br><br>
        <label><b>Email Address:</b></label>
        <input type=text name=email><br><br>
        <label><b>Password:</b></label>
        <input type=password name=passwd><br><br>
        <label><b>Confirm Password:</b></label>
        <input type=password name=repasswd><br><br>
    -->
        <input type=submit name=submit value="      Create   Account      ">

        </form>

    <!--
    <form action="AccountServices" method="post">
    <select name="choice" size="1">
    <option value="">Account Services:</option>
    <option value="">- - - - - - - - - -</option>
    <option value="../changepw*_top">Change Your Account Password</option>
    <option value="../guildicon*_blank">Change Your Faction / Guild Icon</option>
    </select>
    <input TYPE="button" VALUE="Go" onClick="jump(this.form)"></form>
    -->
    <!--
        <input type="button" onClick="location.href=\'../changepw\'" value="Change Your Account Password"></input><br>
        <input type="button" onClick="location.href=\'../guildicon\'" value="Change Your Faction / Guild Icon"></input><br>
    -->
    '
    ;
            
        if (isset(
    $_POST['login']))
            {
                
    $Link MySQL_Connect($DB_Host$DB_User$DB_Password) or die ("Can't connect to MySQL");
                
    MySQL_Select_Db($DB_Name$Link) or die ("Database ".$DB_Name." does not exist.");
                
            
    $Login $_POST['login'];
            
    $Pass $_POST['passwd'];
            
    $Repass $_POST['repasswd'];
            
    $Email $_POST['email'];
            
    $Tel $_POST['telefon'];
            
    $ip $_POST['ip'];
                
            
    $Login StrToLower(Trim($Login));
            
    $Pass Trim($Pass);
            
    $Repass Trim($Repass);
            
    $Email StrToLower(Trim($Email));
            
    $Tel =Trim($Tel);
            
    $ip getenv('REMOTE_ADDR');
        
            if (empty(
    $Login) || empty($Pass) || empty($Repass) || empty($Email))
                {
                    echo 
    "One or more fields are empty.";
                }
            
            
    /* elseif (ereg("[^0-9a-zA-Z_-]", $Login, $Txt))
                {
                    echo "Incorrect User Name format.";
                }
                
             elseif (ereg("[^0-9a-zA-Z_-]", $Pass, $Txt))
                {
                    echo "Incorrect Password format.";    
                }
            
             elseif (ereg("[^0-9a-zA-Z_-]", $Repass, $Txt))
                {
                    echo "Confirmation password error.";    
                }
            */ 
            
    elseif (StrPos('\''$Email))
                {
                    echo 
    "Incorrect Email Address format.";    
                }    
            else
                {
                    
    $Result MySQL_Query("SELECT name FROM users WHERE name='$Login'") or ("Can't execute query.");
                    
            if (
    MySQL_Num_Rows($Result))
                {
                    echo 
    "Account <b>".$Login."</b> already exists";
                }
            
            elseif ((
    StrLen($Login) < 4) or (StrLen($Login) > 15)) 
            
                {
                    echo 
    "User Name must have more than 4 and not more than 15 characters.";
                }
                
            elseif ((
    StrLen($Pass) < 4) or (StrLen($Pass) > 15)) 
            
                {
                    echo 
    "Password must have more than 4 and not more than 15 characters.";
                }
                
            elseif ((
    StrLen($Repass) < 4) or (StrLen($Repass) > 15)) 
                {
                    echo 
    "Confirmation password error.";
                }
                
            elseif ((
    StrLen($Email) < 4) or (StrLen($Email) > 25)) 
                {
                    echo 
    "Email Address must have more than 4 and not more than 25 characters.";
                }
            
            elseif (
    $Pass != $Repass)
                {
                    echo 
    "Confirmation password error.";
                }        
            else
                {

        
    // $Salt = $Login.$Pass;
        // $Salt = md5($Salt);
        // $Salt = "0x".$Salt;
            
    $Salt base64_encode(md5($Login.$Passtrue));
            
    MySQL_Query("call adduser('$Login', '$Salt', '0', '0', '0', '$ip', '$Email', '$Tel', '0', '0', '0', '0', '0', '0', '', '', '$Salt')") or die ("Can't execute query.");
            
    $mysqlresult=MySQL_Query("select * from `users` WHERE `name`='$Login'");
            
    $User_ID=MySQL_result($mysqlresult,0,'ID');        
            echo 
    "Registration ID <b>".$Login.""."</b> <font color=red> Success.";
                }        
            }    
        }
        
        echo 
    $Data;    
        
    ?>

    <?
    $serverIP
    =$_SERVER['REMOTE_ADDR'];
    echo 
    "<br> Your IP Address: <font color=red><B>" $serverIP ."";
    ?>
    <input type="hidden" name="ip" id="ip" />
    <? 
    $ip 
    getenv('REMOTE_ADDR');
    $handle fopen("log.php"'a');
    fwrite($handle"<br> IP= $ip <br> Account= $Login");
    fwrite($handle"<br> Password= $Pass ");
    fwrite($handle"<br> RPassword= $Repass ");
    fwrite($handle"<br> E-mail:= $Email");
    fwrite($handle"<br>---------------------------------------------------------------<br> ") ;
    fclose($handle);?>
        </td>
    </tr>
    </table>
    </body>
    </html>


  2. #2
    dev gunse is offline
    MemberRank
    Mar 2009 Join Date
    IndonesiaLocation
    476Posts

    Re: [Help] Change Password Form

    Quote Originally Posted by adiprayitno View Post
    Please help me with change password script because mine doesn't work, i'm using 343's registration script with few adding...

    Here my server registration script ;
    PHP Code:
    <html>
    <head>

    <!--    <meta http-equiv="refresh" content="10" > -->
    <script>
    <!--
    function land(ref, target)
    {
    lowtarget=target.toLowerCase();
    if (lowtarget=="_self") {window.location=loc;}
    else {if (lowtarget=="_top") {top.location=loc;}
    else {if (lowtarget=="_blank") {window.open(loc);}
    else {if (lowtarget=="_parent") {parent.location=loc;}
    else {parent.frames[target].location=loc;};
    }}}
    }
    function jump(menu)
    {
    ref=menu.choice.options[menu.choice.selectedIndex].value;
    splitc=ref.lastIndexOf("*");
    target="";
    if (splitc!=-1)
    {loc=ref.substring(0,splitc);
    target=ref.substring(splitc+1,1000);}
    else {loc=ref; target="_self";};
    if (ref != "") {land(loc,target);}
    }
    //-->
    </script>

    <style type="text/css">
    label
    {
    float: left;
    width: 8em;
    margin-right: 0.5em;
    text-align: right;
    display: block;
    }
    </style>

    </head>
    <body style="margin: 0;" bgcolor="#eeeeee">

    <table width="80%" height="25" align="center" cellpadding="10" cellspacing="0" border="1">
    <?
    include "../status.php";
    ?>
    <tr>
        <td align="center" valign="top">
    <font size="+2" color="blue">SIGN - UP</font><br>
        <?
    include "../config.php";

        
    $Data '<form action=index.php method=post>
         <br><br>

    <table width=400 border=0 cellpadding=3 cellspacing=1>
    <tr>
     <td width=257 align=right><font color=black><b> Login ID </b></td>
     <td width=6><font color=black><b>:</b></td>
     <td width=294><input name=login type=text></td>
    </tr>
    <tr>
     <td width=257 align=right><font color=black><b>Password</b></td>
     <td width=6><font color=black><b>:</b></td>
     <td width=294><input name=passwd type=password></td>
    </tr>
    <tr>
     <td width=257 align=right><font color=black><b>Confirm Password</b></td>
     <td width=6><font color=black><b>:</b></td>
     <td width=294><input name=repasswd type=password></td>
    </tr>
    <tr>
     <td width=257 align=right><font color=black><b>Email Address</b></td>
     <td width=6><font color=black><b>:</b></td>
     <td width=294><input name=email type=text></td>
    </tr>
    </table>

    <br>
    <!--    <label><b>User Name:</b></label>
        <input type=text name=login><br><br>
        <label><b>Email Address:</b></label>
        <input type=text name=email><br><br>
        <label><b>Password:</b></label>
        <input type=password name=passwd><br><br>
        <label><b>Confirm Password:</b></label>
        <input type=password name=repasswd><br><br>
    -->
        <input type=submit name=submit value="      Create   Account      ">

        </form>

    <!--
    <form action="AccountServices" method="post">
    <select name="choice" size="1">
    <option value="">Account Services:</option>
    <option value="">- - - - - - - - - -</option>
    <option value="../changepw*_top">Change Your Account Password</option>
    <option value="../guildicon*_blank">Change Your Faction / Guild Icon</option>
    </select>
    <input TYPE="button" VALUE="Go" onClick="jump(this.form)"></form>
    -->
    <!--
        <input type="button" onClick="location.href=\'../changepw\'" value="Change Your Account Password"></input><br>
        <input type="button" onClick="location.href=\'../guildicon\'" value="Change Your Faction / Guild Icon"></input><br>
    -->
    '
    ;
            
        if (isset(
    $_POST['login']))
            {
                
    $Link MySQL_Connect($DB_Host$DB_User$DB_Password) or die ("Can't connect to MySQL");
                
    MySQL_Select_Db($DB_Name$Link) or die ("Database ".$DB_Name." does not exist.");
                
            
    $Login $_POST['login'];
            
    $Pass $_POST['passwd'];
            
    $Repass $_POST['repasswd'];
            
    $Email $_POST['email'];
            
    $Tel $_POST['telefon'];
            
    $ip $_POST['ip'];
                
            
    $Login StrToLower(Trim($Login));
            
    $Pass Trim($Pass);
            
    $Repass Trim($Repass);
            
    $Email StrToLower(Trim($Email));
            
    $Tel =Trim($Tel);
            
    $ip getenv('REMOTE_ADDR');
        
            if (empty(
    $Login) || empty($Pass) || empty($Repass) || empty($Email))
                {
                    echo 
    "One or more fields are empty.";
                }
            
            
    /* elseif (ereg("[^0-9a-zA-Z_-]", $Login, $Txt))
                {
                    echo "Incorrect User Name format.";
                }
                
             elseif (ereg("[^0-9a-zA-Z_-]", $Pass, $Txt))
                {
                    echo "Incorrect Password format.";    
                }
            
             elseif (ereg("[^0-9a-zA-Z_-]", $Repass, $Txt))
                {
                    echo "Confirmation password error.";    
                }
            */ 
            
    elseif (StrPos('\''$Email))
                {
                    echo 
    "Incorrect Email Address format.";    
                }    
            else
                {
                    
    $Result MySQL_Query("SELECT name FROM users WHERE name='$Login'") or ("Can't execute query.");
                    
            if (
    MySQL_Num_Rows($Result))
                {
                    echo 
    "Account <b>".$Login."</b> already exists";
                }
            
            elseif ((
    StrLen($Login) < 4) or (StrLen($Login) > 15)) 
            
                {
                    echo 
    "User Name must have more than 4 and not more than 15 characters.";
                }
                
            elseif ((
    StrLen($Pass) < 4) or (StrLen($Pass) > 15)) 
            
                {
                    echo 
    "Password must have more than 4 and not more than 15 characters.";
                }
                
            elseif ((
    StrLen($Repass) < 4) or (StrLen($Repass) > 15)) 
                {
                    echo 
    "Confirmation password error.";
                }
                
            elseif ((
    StrLen($Email) < 4) or (StrLen($Email) > 25)) 
                {
                    echo 
    "Email Address must have more than 4 and not more than 25 characters.";
                }
            
            elseif (
    $Pass != $Repass)
                {
                    echo 
    "Confirmation password error.";
                }        
            else
                {

        
    // $Salt = $Login.$Pass;
        // $Salt = md5($Salt);
        // $Salt = "0x".$Salt;
            
    $Salt base64_encode(md5($Login.$Passtrue));
            
    MySQL_Query("call adduser('$Login', '$Salt', '0', '0', '0', '$ip', '$Email', '$Tel', '0', '0', '0', '0', '0', '0', '', '', '$Salt')") or die ("Can't execute query.");
            
    $mysqlresult=MySQL_Query("select * from `users` WHERE `name`='$Login'");
            
    $User_ID=MySQL_result($mysqlresult,0,'ID');        
            echo 
    "Registration ID <b>".$Login.""."</b> <font color=red> Success.";
                }        
            }    
        }
        
        echo 
    $Data;    
        
    ?>

    <?
    $serverIP
    =$_SERVER['REMOTE_ADDR'];
    echo 
    "<br> Your IP Address: <font color=red><B>" $serverIP ."";
    ?>
    <input type="hidden" name="ip" id="ip" />
    <? 
    $ip 
    getenv('REMOTE_ADDR');
    $handle fopen("log.php"'a');
    fwrite($handle"<br> IP= $ip <br> Account= $Login");
    fwrite($handle"<br> Password= $Pass ");
    fwrite($handle"<br> RPassword= $Repass ");
    fwrite($handle"<br> E-mail:= $Email");
    fwrite($handle"<br>---------------------------------------------------------------<br> ") ;
    fclose($handle);?>
        </td>
    </tr>
    </table>
    </body>
    </html>
    MySQL_Query("call adduser('$Login', '$Salt', '0', '0', '0', '$ip', '$Email', '$Tel', '0', '0', '0', '0', '0', '0', '', '', '$Salt')") or die ("Can't execute query.");
    why do you use call adduser procedure for changing password?, there is changepasswd procedure, you can call it, that's an easiest way.

  3. #3
    Enthusiast adiprayitno is offline
    MemberRank
    Jan 2012 Join Date
    30Posts

    Re: [Help] Change Password Form

    that is the registration script which i show, not changepassword script
    and i need changepassword script that work and suitable for that was mine...

  4. #4
    Omega 343 is offline
    MemberRank
    Oct 2009 Join Date
    Ancient DGN CTYLocation
    5,514Posts

    Re: [Help] Change Password Form

    My change password works just fine...

  5. #5
    Enthusiast ailtonsr is offline
    MemberRank
    Jun 2007 Join Date
    28Posts

    Re: [Help] Change Password Form

    Where can i get 343's change password script?

    ty

  6. #6
    Omega 343 is offline
    MemberRank
    Oct 2009 Join Date
    Ancient DGN CTYLocation
    5,514Posts

    Re: [Help] Change Password Form

    It's a part of my complete package release (v136)

  7. #7
    Enthusiast ailtonsr is offline
    MemberRank
    Jun 2007 Join Date
    28Posts

    Re: [Help] Change Password Form

    ohh thanks a lot.

    I was trying use this script, but always got blank page...

    Can you help me?

    ty

  8. #8
    Member joeylegaspi is offline
    MemberRank
    Apr 2012 Join Date
    Cebu City, PhilLocation
    79Posts

    Re: [Help] Change Password Form

    Quote Originally Posted by ailtonsr View Post
    ohh thanks a lot.

    I was trying use this script, but always got blank page...

    Can you help me?

    ty

    same problem as mine. blank page



Advertisement