索引登录页面用户名/密码 [英] Index loginpage username/password
本文介绍了索引登录页面用户名/密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我正在寻找可以帮助我的人;
我将创建一个登录页面,但我所做的一切都可以按下提交按钮而不插入用户名和密码
我尝试了什么: < br $> b $ b
Hi There,
I am looking for someone who can help me with this;
I will create an login page but everything I do I can press the submit button without insert username and password
What I have tried:
<pre><body class="login">
<form action="index.php" method="post">
<div id="login-wrapper">
<div id="login_header">
<font color="00000"><h3>Dashboard</h3></font>
</div>
<div class="login-user">
<img src="img/user.png" alt="User" />
</div>
<?php
session_start();
$userinfo = array(
'user1'=>'password1',
'user2'=>'password2'
);
if(isset($_GET['logout'])) {
$_SESSION['username'] = '';
header('Location: ' . $_SERVER['PHP_SELF']);
}
if(isset($_POST['username'])) {
if($userinfo[$_POST['username']] == $_POST['password']) {
$_SESSION['username'] = $_POST['username'];
}else {
echo "You have not requested a login form!";
}
}
?>
<h5>Sign in to access to your Mustang admin control panel.</h5>
<div id="inputs">
<div class="form-block">
<input type="text" name="username" value="">
</div>
<div class="form-block">
<input type="password" name="password" value="" />
</div>
<input type="submit" value="Login" />
</div>
</div>
</form>
</body>
推荐答案
userinfo = array(
' user1' => ' password1',
' user2' => ' password2'
);
if(isset(
userinfo = array( 'user1'=>'password1', 'user2'=>'password2' ); if(isset(
_GET [' 注销'])){
_GET['logout'])) {
_SESSION [' username' ] = ' ';
header(' 位置:'。
_SESSION['username'] = ''; header('Location: ' .
这篇关于索引登录页面用户名/密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文