将userdata保存到数据库

时间:2017-01-16 20:44:34

标签: php html mysql mysqli sublimetext

上周我一直试图为我的新网站建立一个登录系统。但无论我下载什么youtube视频,我都无法将数据传输到localhost。我不知道问题是什么,所以我试着问一下是否有人知道什么是错的。因此,当我注册时,没有任何事情像要求我保存密码到chrome。并且它不会将数据保存到我的localhost数据库表:(我很困惑..

我在Mac上使用Hostgator作为主机,localhost作为数据库使用。

继承我的registrer.php代码

<!DOCTYPE html>
<html>



<head>

    <title>Login/Sign Up</title>

<link rel="stylesheet" type="text/css" href="LoginOrSignUpStyle.css">

</head>



<body>

    <div>
<h1>Login or Sign Up</h1>

<center>
<p>

<ul id="menu">
<li id="items"><a href="index.html">Home</a></li>
<li id="items"><a href="LoginOrRegistrer.php">Login/Signup</a></li>
<li id="items"><a href="Leaderboards.html">Leaderboards</a></l1>
<li id="items"><a href="Contact.html">Contact us</a></li>

</ul>

    </p>

    </div>



    <form name="Login1" method="post" action="registrer.php">
<input type="text" id="usernamecss" name="username1" placeholder="Username" required> <br>
<input type="password" id="passwordcss" name="password1" placeholder="Password" required> <br>

</form>



<form name="Registrer1" method"post" action="registrer.php">
<input id="firstname"type="text" name="firstname" placeholder="First name" required> <br>
<input id="lastname" type="text"  name="lastname" placeholder="Last name" required> <br>
<input id="usernameregistrer" type="text"  name="username" placeholder="Username" required> <br>
<input id="email" type="text"  name="email" placeholder="Email-Adress" required> <br>
<input id="passwordregistrer" type="text"  name="password" placeholder="Password" required> <br>
<input type="submit" name="submit1" value="Registrer">
    </form>







<div id="main">
<p><h2>Forgotten password?</h2><p/>


<p>Game World is a brand new website created by Cilus Apps. It has hundreds of games to play, both singleplayer and multiplayer! You can play games or whatch your friends live while playing against other players!
    you can also bet who is going to win, and if you bet right, you win the money the peoples who betted wrong betted.<p>
       <p>Registrer today and join the fun! The first day is free!</p>
</div>

</center>


<p id="footer">Copyright &copy; 2017 Cilus</p>
    </body>



<?php
if (isset($_POST["submit1"])) {

    $link=mysqli_connect("host","username","password");
    mysqli_select_db($link,"users");
     mysqli_query($link,"sett inn registrerings verdia('','$_POST[firstname]','$_POST[lastname]','$_POST[username]','$_POST[email]','$_POST[password]')");

}

?>

</html>

0 个答案:

没有答案