<?php
if ($newpass1==$newpass2) //matching newpass
{
$host="localhost";
$user="user";
$password="arsenal";
$dbname="member";
mysql_connect($host,$user,$password) or die ("Can not connect host");
mysql_select_db($dbname) or die ("Can not connect database");
$sql=" SELECT * FROM member WHERE mem_name='$username' AND mem_password='$pw' ";
$dbquery = mysql_db_query($dbname,$sql);
$num_rows = mysql_num_rows($dbquery);
if($num_rows==1)
{
$sql1="UPDATE member SET mem_password='$newpass1' WHERE mem_name='$username' ";
$dbquery1 = mysql_db_query($dbname,$sql1);
print "Update complete <a href=\"checkuser.php\"> go to content </a> " ;
}
}
else
{
print "Both passwords not match! <a href =\"changeform.php\"> กลับไปหน้าที่แล้ว </a> ";
}
?>
Tag : - - - -
Date :
10 ต.ค. 2550 16:11:51
By :
นิดหน่อย
View :
1465
Reply :
1
No. 1
Guest
เท่าที่ดูโค้ดนะคับ
$sql=" SELECT * FROM member WHERE mem_name='$username' AND mem_password='$pw' ";