Q
PHP登录系统?
-3
A
回答
1
0
如果你想要一个基本的网站登录系统,试试这个。
登录形式:
<form id="login-form" class="loginform" action='include/login.inc.php' method='POST'>
<input id="login-email" type='text' name='email' placeholder='Email'>
<input id="login-pwd" type='password' name='pwd' placeholder='Password'>
</form>
然后添加PHP代码。
Login.inc.php:
<?php
session_start();
include '../dbh.php';
$email = $_POST['email'];
$pwd = $_POST['pwd'];
$sql = "SELECT * FROM user WHERE email= ? ";
$stmt = mysqli_prepare($conn, $sql);
mysqli_stmt_bind_param($stmt, 's', $email);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
$row = mysqli_fetch_assoc($result);
if(password_verify($pwd, $row['pwd'])) {
$_SESSION['id'] = $row['id'];
$userID = $row['id'];
header("Location: ../profile.php?id=$userID");
exit();
} else {
header("Location: ../login-error-page.php");
exit();
}
?>
相关问题
- 1. PHP登录系统
- 2. Php登录系统-null值登录
- 3. PHP登录系统错误?
- 4. PHP/MySQL的登录系统
- 5. 双重登录PHP系统
- 6. 登录系统使用PHP
- 7. PhP登录/注册系统
- 8. PHP会话登录系统
- 9. Android php登录系统
- 10. PHP + MySQL登录系统
- 11. PHP登录系统问题
- 12. PHP登录系统。安全?
- 13. Cookie Stealer /登录系统(PHP)
- 14. php会话登录系统
- 15. PHP/MySQL登录系统 -
- 16. Jquery/PHP ajax登录系统
- 17. MySQL Php登录系统
- 18. Php登录系统错误
- 19. PHP系统登录错误
- 20. SQL登录系统
- 21. joomla登录系统
- 22. MyspaceID登录系统
- 23. ASP.NET登录系统
- 24. Wpf登录系统
- 25. 系统登录Ruby?
- 26. Laravel登录系统
- 27. CakePHP登录系统
- 28. Android登录系统
- 29. Django登录系统
- 30. PHP的登录系统问题
你能改一下你的问题吗?我不明白你在问什么,你似乎也没有使用任何标点符号。 – Seth 2009-12-01 20:16:51