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.$Pass, true));
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>


Reply With Quote![[Help] Change Password Form](http://ragezone.com/hyper728.png)



