<html>
<head><title>会员注册系统</title></head>
<body bgcolor="white"text="black"link="blue"vlink="purple"alink="red">
<h1 align="center">会员注册</h1>
<form name="form1"method="POST"action="add_chk.php">
<p align="center">请输入你要使用的帐号:<input type="text"name="id"></p>
<p align="center">请输入你要使用的密码:<input type="password"name="password"></p>
<p align="center">请重复输入你的密码以确认:<input type="password"name="repassword"></p>
<p align="center"><input type="submit"name="提交"><input type="reset"name="重设"></p>
</form>
</body>
</html>
<html>
<head><title>会员确认</title></head>
<body>
<?php
include_once("sql_connect.php");
include_once("my_msg.php");
?>
<?php
//检查数据
if($_POST['id']==''or$_POST['password']==''or$_POST['repassword']=='')
{
my_msg("字段不可空白","add.html");
}
if($_POST['password']!=$_POST['repassword'])
{
my_msg("密码不相同,请输入相同的密码!","add.html");
}
$sqlstr="insert into member values('','".$_POST['id']."','".$_POST['password']."',1,1)";
//组合sql
$result=mysql_query($sqlstr,Slink);
//执行sql
//跳至窗口
my_msg("添加用户成功,请记住你的帐号和密码!","login.html");
mysql_free_result($result);
mysql_colse($link);
?>
</body>
</html>其中sql_connect.php和my_msg.php的代码以及example数据库和member表都有。
在第一段代码中输入用户户名和密码以及确认密码后点击提交按钮,然后弹出一个文件下载的窗口,有打开,保存,取消三个按钮。选择打开则会打开第二段代码。请高手指教啊
<head><title>会员注册系统</title></head>
<body bgcolor="white"text="black"link="blue"vlink="purple"alink="red">
<h1 align="center">会员注册</h1>
<form name="form1"method="POST"action="add_chk.php">
<p align="center">请输入你要使用的帐号:<input type="text"name="id"></p>
<p align="center">请输入你要使用的密码:<input type="password"name="password"></p>
<p align="center">请重复输入你的密码以确认:<input type="password"name="repassword"></p>
<p align="center"><input type="submit"name="提交"><input type="reset"name="重设"></p>
</form>
</body>
</html>
<html>
<head><title>会员确认</title></head>
<body>
<?php
include_once("sql_connect.php");
include_once("my_msg.php");
?>
<?php
//检查数据
if($_POST['id']==''or$_POST['password']==''or$_POST['repassword']=='')
{
my_msg("字段不可空白","add.html");
}
if($_POST['password']!=$_POST['repassword'])
{
my_msg("密码不相同,请输入相同的密码!","add.html");
}
$sqlstr="insert into member values('','".$_POST['id']."','".$_POST['password']."',1,1)";
//组合sql
$result=mysql_query($sqlstr,Slink);
//执行sql
//跳至窗口
my_msg("添加用户成功,请记住你的帐号和密码!","login.html");
mysql_free_result($result);
mysql_colse($link);
?>
</body>
</html>其中sql_connect.php和my_msg.php的代码以及example数据库和member表都有。
在第一段代码中输入用户户名和密码以及确认密码后点击提交按钮,然后弹出一个文件下载的窗口,有打开,保存,取消三个按钮。选择打开则会打开第二段代码。请高手指教啊
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货