我正在尝试实现从http://www.php-login.net/登录到我的网页的PHP-登录脚本。我下载了2-高级脚本,创建了数据库,并根据提供的教程将其配置为"config.php“。我还在我的网站上插入了这个表格。
我的问题是为什么表单不工作?
以下是我使用的表格:
<form method="post" action="index.php" name="loginform">
<label for="login_input_username">Username</label>
<input id="login_input_username" class="login_input" type="text" name="user_name" required />
<label for="login_input_password">Password</label>
<input id="login_input_password" class="login_input" type="password" name="user_password" autocomplete="off" required />
<input type="submit" name="login" value="Log in" />
</form>
<a href="register.php">Register new account</a>
<a href="password_reset.php">I forgot my password</a>表单和按钮不工作,单击后显示下一条消息:
<?php
/**
* A simple, clean and secure PHP Login Script
*
* ADVANCED VERSION
* (check the website / GitHub / facebook for other versions)
*
* A simple PHP Login Script.
* Uses PHP SESSIONS, modern password-hashing and salting
* and gives the basic functions a proper login system needs.
*
* @package php-login
* @author Panique
* @link https://github.com/panique/php-login/
* @license http://opensource.org/licenses/MIT MIT License
*/
// load php-login components
require_once("php-login.php");
// create a login object. when this object is created, it will do all login/logout stuff automatically
// so this single line handles the entire login process.
$login = new Login();
// ... ask if we are logged in here:
if ($login->isUserLoggedIn() == true) {
// the user is logged in. you can do whatever you want here.
// for demonstration purposes, we simply show the "you are logged in" view.
include("views/logged_in.php");
} else {
// the user is not logged in. you can do whatever you want here.
// for demonstration purposes, we simply show the "you are not logged in" view.
include("views/not_logged_in.php");
}欢迎任何帮助和建议,并非常感谢您的支持。
发布于 2013-11-19 12:23:28
答案很简单。您的服务器上没有激活PHP。这就是为什么它只显示PHP代码而不执行它的原因。
发布于 2013-11-19 13:20:02
您是否将表单保存为php而不是HTML?因为在从HTML到php的过程中,HTML倾向于显示或下载php文件,所以HTML无法处理php文件。
发布于 2013-11-19 12:27:48
形式基础行动:
<form action="<?php echo URL; ?>login/login" method="post">你的表格
<form method="post" action="index.php" name="loginform">尝试更改操作
action="<?php echo URL; ?>login/login"https://stackoverflow.com/questions/20071367
复制相似问题