用php编了注册页面,想要传送到mysql数据库里,能够注册并实现跳转,但是数据库没有插入信息
代码如下:<?phpinclude("connect.php");mysql_select_db("shopping");$name=$_POST['name'];$pa...
代码如下:
<?php
include("connect.php");
mysql_select_db("shopping");
$name = $_POST['name'];
$password = $_POST['password'];
$nickname = $_POST['nickname'];
$sex =$_POST['sex'];
mysql_query("insert into user(nickname,name,password,sex,)
VALUES('$nickname','$name','$password','$sex')");
mysql_close($conn);
?>
<html>
<head>
<meta charset="utf-8">
<title>信息</title>
<style type="text/css">
<!--
.unnamed2 { font-size: 12pt; color: red;text-align:center;"}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body bgColor=#ffffff leftMargin=0 topMargin=5 marginwidth="0">
<br><br><br><hr size=1 width="90%" align="center">
<table align=center border=0 cellPadding=0 cellSpacing=0 width="80%">
<tr bgColor=#d7ebff valign="bottom">
<td align=right class=unnamed2 width="40%"><?php echo"注册成功" ?>
<a href="zhuce.php"><img src="return.gif" width="50" height="21" alt=""/></a>
</td>
</tr>
</table>
<hr size=1 width="90%" align="center">
</style>
</head>
</html> 展开
<?php
include("connect.php");
mysql_select_db("shopping");
$name = $_POST['name'];
$password = $_POST['password'];
$nickname = $_POST['nickname'];
$sex =$_POST['sex'];
mysql_query("insert into user(nickname,name,password,sex,)
VALUES('$nickname','$name','$password','$sex')");
mysql_close($conn);
?>
<html>
<head>
<meta charset="utf-8">
<title>信息</title>
<style type="text/css">
<!--
.unnamed2 { font-size: 12pt; color: red;text-align:center;"}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body bgColor=#ffffff leftMargin=0 topMargin=5 marginwidth="0">
<br><br><br><hr size=1 width="90%" align="center">
<table align=center border=0 cellPadding=0 cellSpacing=0 width="80%">
<tr bgColor=#d7ebff valign="bottom">
<td align=right class=unnamed2 width="40%"><?php echo"注册成功" ?>
<a href="zhuce.php"><img src="return.gif" width="50" height="21" alt=""/></a>
</td>
</tr>
</table>
<hr size=1 width="90%" align="center">
</style>
</head>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询