- 精华
- 阅读权限
- 20
- 好友
- 相册
- 分享
- 听众
- 收听
- 注册时间
- 2018-1-20
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
发表于 2018-1-20 21:22:17
|
显示全部楼层
<?php
session_start();
header("Content-type:text/html;charset=utf-8");
$link = mysqli_connect('localhost','root','root','q10');
if (!$link) {
die("连接失败:".mysqli_connect_error());
}
$username = $_POST['username'];
$num = $_POST['num'];
if($username == "" || $num == "")
{
echo "<script>alert('信息不能为空!重新填写');window.location.href='pay.html'</script>";
} else{
$sql= "update t_u_player set dj = {$num} where name = '{$username}'";
//插入数据库
if(!(mysqli_query($link,$sql))){
echo "<script>alert('数据插入失败');window.location.href='pay.html'</script>";
}else{
echo "<script>alert('成功');window.location.href='pay.html'</script>";
}
}
?> |
|