所以我编辑了我的代码,但仍然无法获得结果代码的一部分负责报告也不起作用的错误我愿意接受其他编码方式来完成工作,只要它适合代码这里是代码
<?php
require 'core.inc.php';
if(!loggedIn()) {
//check mikunim ke tamame field ha dar form vojod darand va set shudan
if(isset($_POST['username'])&&isset($_POST['password'])&&isset($_POST['password_again'])&&isset($_POST['firstname'])&&isset($_POST['surname'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$password_again = $_POST['password_again'];
$firsname = $POST['firstname'];
$surename = $POST['surename'];
//HALA CHECK MIKUNIM KHALI HASTAND YA NA
if(!empty($username)&&!empty($password)&&!empty($email)&&!empty($firstname)&&!empty($surename)){
echo 'ok' ;
} else {
echo ' All fields are required';
}
}
?>
<form action="register.php" method="POST">
Username:<br> <input type="text" name="username"><br> <br>
Password:<br> <input type="password" name="password"><br><br>
Password again:<br> <input type="password" name="password_again"><br><br>
Firstname:<br> <input type="text" name="firstname"><br><br>
Surname:<br> <input type="text" name="surename"><br><br>
<input type="submit" value="register">
</form>
<?php
} else if (loggedIn()) {
echo 'you \'re already logged in';
}
我又编辑了,现在我明白了
注意:未定义索引:HTTP_REFERER
$http_referer = $_SERVER['HTTP_REFERER']
我从教程中使用了这个