📄 modifyok.php
字号:
<?
//初始化session
session_start();
// 包含数据库连接文件
require ('dbconnect.php');
// 必须要用户登录后才能进入修改页面,检测是否登录
if(!isset($_SESSION['username'])) {
echo "<p align=center>";
echo "<font color=#FF0000 size=5><strong><big>";
echo "您还没有登录,请<a href='userlogin.php'>登录</a>!";
echo "</big></strong></font></p>";
exit();
}
?>
<?
// 获得参数
$email=$_POST['email'];
$oicq=$_POST['oicq'];
$homepage=$_POST['homepage'];
$city=$_POST['city'];
$address=$_POST['address'];
$zip=$_POST['zip'];
$tel=$_POST['tel'];
$edu=$_POST['edu'];
$introduction=$_POST['introduction'];
$interest=$_POST['interest'];
$id=$_POST['id'];
if ($photo<>""){
$fp=fopen($photo,"r");
$data=addslashes(fread($fp,filesize($photo)));
$sql="update member set email='$email', oicq='$oicq', homepage='$homepage', city='$city', address='$address', zip='$zip', tel='$tel', edu='$edu', introduction='$introduction', interest='$interest', photo='$data' where id='$id'";
}
else {
$sql="update member set email='$email', oicq='$oicq', homepage='$homepage', city='$city', address='$address', zip='$zip', tel='$tel', edu='$edu', introduction='$introduction', interest='$interest' where id='$id'";
}
mysql_query($sql,$conn) or die ("更新数据失败: ".mysql_error());
// 关闭连接
mysql_close($conn);
// 重定向到注册成功页面
header("Location:regok.php?id=$id");
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -