我想创建一个模拟账户。如何创建不需要数据库的简易登录控制器?
这是我的观点。
<div class="col-lg-12">
<label class="control-label">
Username / Email Address
</label>
</div>
<div class="col-lg-12">
<input class="form-control" type="text" name="email_address" autofocus />
</div>
<div class="col-lg-12">
<label class="control-label">
Password:
</label>
</div>
<div class="col-lg-12">
<input class="form-control" type="password" name="password" />
</div>
<div class="col-lg-12">
<input type="submit" name="button" value="" class="btn-submit-student"/>
</div>
答案 0 :(得分:0)
使用此(我理解您的问题)
<?php
if(isset($_POST['button']))
{
$user = $_POST['email_address'];
$pw = $_POST['password'];
if($user =='my_username' and $pw=='My_Password')
{
//code if user name and Password matched
echo 'Sucess';
}
else
{
//username and password Failed
echo 'Failed';
}
}