gpt4 book ai didi

php - 用于登录的后端系统无法正常工作

转载 作者:行者123 更新时间:2023-11-29 07:31:03 26 4
gpt4 key购买 nike

我是 PHP 新手,还在学习中。当我为我的登录系统单击提交时,我没有看到任何迹象表明登录详细信息已被处理并发送到 MYSQL 后端(名为帐户的数据库)。有人可以帮助我并告诉我为什么会这样吗,它应该在单击注册时重定向到 database-handler.php。提前致谢。

索引.php:

<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://fonts.googleapis.com/css?family=Slabo+27px" rel="stylesheet">
<link href="style.css" rel="stylesheet">
<meta charset="UTF-8">
<title>HappySocial</title>
</head>
<body>
<center>
<div class="outer">
<div class="inner">
<div id="sign_up">
<h2>Happy Social</h2>
<form autocomplete="off" action="database-handler.php" method="POST">
<input type = "text" id="first_name" placeholder="First Name">
<br><br>
<input type = "text" id="last_name" placeholder="Last Name">
<br><br>
<input type = "text" id="username" placeholder="Username">
<br><br>
<input type = "text" id="password" placeholder="Password">
</form>
<br>
<input type="submit" id="sign_up_button" class="button"></>
</div>
<br>
<div id="sign_in">
<h3>Already have an account?</h3>
<button id="sign_in_button" class="button">Sign In</button>
</div>

</div>
</div>

</body>
</html>

数据库处理程序.php:

<?php

$con = mysqli_connect("localhost", "root","password") or die("Unable to connect");
mysqli_select_db("accounts", $con);

?>

最佳答案

您必须对数据库执行查询才能检索数据。

mysqli_query($con, "SELECT * FROM tableName WHERE user=x AND password=y");

阅读更多:

关于php - 用于登录的后端系统无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51228856/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com