在PHPMYSQL中分配一次用户名
我正在使用在PHPMYSQL中分配一次用户名,php,Php,我正在使用登录脚本。我有一个注册和它的登录,我需要给一个单一的访问/登录,我在数据库表名中有我的字段是qz_userauthasIDfnamelname电子邮件用户名密码。在一次尝试后限制登录。可能吗 这是登录表单 <form action="functions.php" method="post" id="login"> <fieldset> <legend>Login </leg
登录
脚本
。我有一个注册和它的登录,我需要给一个单一的访问/登录,我在数据库表名中有我的字段是qz_userauth
asID
fname
lname
电子邮件用户名密码。在一次尝试后限制登录。可能吗
这是登录表单
<form action="functions.php" method="post" id="login">
<fieldset>
<legend>Login </legend>
<ul>
<li>
<label for="username"><span class="required">Username</span></label>
<input id="username" name="username" class="text required" type="text" />
<label for="username" class="error">This field cannot be empty</label>
</li>
<li>
<label for="password"><span class="required">Password</span></label>
<input name="password" type="password" class="text required" id="password" maxlength="20" />
</li>
<?php if($_SESSION['LCNT']>=4){ ?>
<li>
<p id="p-captcha">
<div id="captchaImg"><img id="captcha" src="captcha/securimage_show.php" alt="CAPTCHA Image" /></div>
<div id="captchaInput"><input type="text" name="captcha_code" size="16" maxlength="6" value="Enter Captcha" /></div>
<div id="captchaRefresh"><a href="#" onclick="document.getElementById('captcha').src = 'captcha/securimage_show.php?' + Math.random(); return false"><img src="captcha/images/refresh.gif" /></a></div>
</p>
</li>
<?php } ?>
<li>
<label class="centered info"><a id="forgotpassword" href="fpass.php">Forgot Your password...</a></label>
</li>
</ul>
</fieldset>
<input type="hidden" name="action" value="login" />
<fieldset class="submit">
<input type="submit" class="sbutton" value="Login" /> <input type="button" class="sbutton" value="Register" onclick="window.location='register.php'" />
</fieldset>
</form>
登录
-
用户名
此字段不能为空
-
密码
-
-
如果您想询问您希望每个用户一次只允许一次登录,那么您可以向表中添加另一个字段,例如登录\u状态。当用户登录时将其设置为1,注销时将其设置为0。然后在您的登录脚本中检查这是否为0,然后才允许登录如果您的意思是要求每个用户一次只允许一次登录,那么您可以向表中添加另一个字段,如login\u status。当用户登录时将其设置为1,注销时将其设置为0。然后在登录脚本中检查这是否为0,然后才允许登录只需在表中再设置一个字段作为标志。在一次登录尝试后,将flag的值设置为false。并在登录时检查标志值。只需在表中再设置一个字段作为标志。在一次登录尝试后,将flag的值设置为false。并在登录时检查标志值。所有可能,但您需要在此处添加/显示一些编码部分的工作所有可能,但您需要在此处添加/显示一些编码部分的工作真的非常感谢@I完成了工作..正是因为您的tips@KritikaGupta干杯很高兴我能这么做,真的非常感谢,我做了这项工作,就因为你tips@KritikaGupta干杯,很高兴我能指引你