<?php //表单处理程序
/*1.获取表单变量 根据表单提交的方法选择合适的方式获取表单变量: method=post($_POST["NAME"]) method=get($_GET["NAME"]) */ $name = $_POST["name"]; $*** = $_POST["***"]; $password = $_POST["password"]; $favorite = $_POST["favorite"]; $province = $_POST["province"]; $choice = $_POST["choice"]; $remark = $_POST["remark"]; $id = $$_POST["id"];
//2.判断用户输入的表单数据的合法性 if($name == "" or strlen($password) < 3){ /* echo "<font size=6 color=red>您必须输入姓名!</font>"; return; */ die("<font size=6 color=red>您必须输入姓名或者姓名长度不符合要求!</font>"); } if(strlen($password) < 6){ die("<font size=6 color=red>密码长度不符合要求!</font>"); }
//3.处理表单 /* 例如:查询数据库,将数据插入数据库,等其他操作。 */ //将用户信息插入数据库
//4.返回处理结果 /* 无论操作成功与否,都应该给用户提示! */ echo "注册成功!"; ?>
try{parent.JS.modules[window.name].content.setHeight();}catch(e){}
|