单击提交按钮时,下面的代码应该在表单上方给出错误或确定。但问题是它不会做任何事情。谁能告诉我我在这里做错了什么?
<?php
include 'ini.php';
?>
<?php
if(isset ( $_POST['reg_u_name'],$_POST['reg_email'], $_POST['reg_password'] )) {
$reg_u_name = $_POST['reg_u_name'];
$reg_email = $_POST['reg_email'];
$reg_password = $_POST['reg_password'];
$errors = array();
if (empty($reg_u_name) || empty($reg_email) || empty($reg_password)) {
$errors[] = 'All fields required';
}else{
echo 'OK';
}
}
?>
<form action="" method="post">
<p>Username:<br/><input type="text" name="reg_u_name" maxlength="20" ></p>
<p>Email:<br/><input type="text" name="reg_email" maxlength="20" ></p>
<p>Password:<br/><input type="password" name="reg_password" maxlength="20" ></p>
<p><input type="submit" value="Register"></p>
</form>
ini.php 文件
<?php
session_start();
error_reporting(0);
require 'connect.php';
include 'user.func.php';
?>