📄 user_data.php
字号:
<?PHP
/*---------------------------------------------- This is where the work is done --------------------------------------*/
//Change Email Address
if(isset($_POST['newmail']))
{
if($new_email == $new_email2)
{
$conn;
mysql_query("UPDATE users SET email= '$new_email' WHERE username= '$username'");
echo "<hr><br />Your email address has been changed to " . $new_email . ".";
}
else
{
echo "<hr><br />Your entries did not match. <br /> New Email: " . $new_email . "<br /> Confrimed Email: " . $new_email2;
}
}
//check passwords to make sure they all match then modify the users password as requested
if(isset($_POST['pass_change']))
{
if(($new_passw == $confirm_pass) && ($pass['password'] == $oldpass))
{
$conn;
mysql_query("UPDATE users SET password= '$new_passw' WHERE username= '$username'");
echo "<hr><br />Your password has been updated. <strong>You are now logged out! </strong>";
mysql_close($conn);
}
else
{
//Something went wrong
echo "<hr><br />Your entries did not match or your current password was invalid. Please try again.";
}
}
//Change user name
if(isset($_POST['name_change']))
{
if($n_name)
{
$conn;
mysql_query("UPDATE users SET username= '$n_name' WHERE username= '$username'");
echo "<hr> <br /> Your user name has been changed. <strong> You are now logged out! </strong>";
mysql_close($conn);
}
else
{
//Something went wrong
echo "<hr> <br /> Your name was not changed. Please try again.";
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -