need sm help
Posted: Sat Jun 21, 2008 12:00 am
hi guys
i own a mmorpg game server wich uses msql2000 dbs
m just a newbie php programmer n i m creating a change password page fr my MSSQL2000 server
but i cant get my thing 2 be done
this is what i want to do

Kindly help plss..................
here s my code
but it cannot check the current pass field with the actuall pass
getting no error msgs.. but its unable 2 check
i own a mmorpg game server wich uses msql2000 dbs
m just a newbie php programmer n i m creating a change password page fr my MSSQL2000 server
but i cant get my thing 2 be done
this is what i want to do

Kindly help plss..................
here s my code
but it cannot check the current pass field with the actuall pass
getting no error msgs.. but its unable 2 check
Code: Select all
<?php
$dbname="ASD";
$user="sa";
$pass="sa";
$conn = odbc_connect($dbname, $user,$pass );
$newpass="$_POST[newpass]";
$confirmpass="$_POST[confirmpass]";
$currentpass = "$_POST[currentpass]";
$userid = "$_POST[userid]";
$chckpass = "SELECT c_headera FROM account WHERE c_id ='$userid'";
$realcheck = odbc_exec($conn, $chckpass);
$realpass = odbc_result($realcheck,'c_headera');
echo $realpass;
if ($realpass = $newpass)
ECHO "Current Password Is Wrong";
else
switch ($newpass)
{
case $confirmpass:
$query = "update account set c_headera='$_POST[newpass]', c_headerb='$_POST[newpass]', c_headerc='$_POST[newpass]', c_sheadera='$_POST[newpass]', c_sheaderb='$_POST[newpass]', c_sheaderc='$_POST[newpass]' where c_id='$_POST[userid]'";
$result = odbc_Exec($conn, $query);
echo "Password Changed Successfully!";
break;
default:
Echo "Passwords Do Not Match";
}
?>