dongran1779 2019-07-13 16:35
浏览 52

用于连接和设置没有像xampp这样的应用程序的用户数据库的代码

I cant figure out how to set up a php script to coincide with my html so that when a new user is made, it sends their info to the database. but with the way i have the login page setup, its all just html and css. Is there a way i could get the php script to send all the data in my forms to the mysql database? Below is all the html code /aside from the css, as it is very long/ I want to connect this whole thing together with php, mysql and apache. Ive already set them up and my html file is index.html

<body>
  <div class="header" id="myHeader">
    <h2 id="FromentFilms">Froment Films</h2>
    <button
      class="openbutton2"
      onclick="document.getElementById('ido12').style.display='block'"
    >
      signup
    </button>
    <div id="ido12" class="modal2">
      <div class="w3-modal-content w3-animate-top">
        <span
          onclick="document.getElementById('ido12').style.display='none'"
          class="close2"
          title="Close Modal"
          >&times;</span>
        <form class="modal-content2" action="index.php">
          <div class="container2">
            <h1>Sign Up</h1>
            <p>Please fill in this form to create an account.</p>
            <hr />
            <label for="email2"><b>Email</b></label>
            <input
              type="text"
              placeholder="Enter Email"
              name="email2"
              required
            />

            <label for="psw2"><b>Password</b></label>
            <input
              type="password"
              placeholder="Enter Password"
              name="psw2"
              required
            />

            <label for="psw-repeat2"><b>Repeat Password</b></label>
            <input
              type="password"
              placeholder="Repeat Password"
              name="psw-repeat2"
              required
            />

            <label>
              <input
                type="checkbox"
                checked="checked"
                name="remember2"
                style="margin-bottom:15px"
              />
              Remember me
            </label>

            <p>
              By creating an account you agree to our
              <a href="#" style="color:dodgerblue">Terms & Privacy</a>.
            </p>

            <div class="clearfix">
              <button
                type="button"
                onclick="document.getElementById('ido12').style.display='none'"
                class="cancelbtn2"
              >
                Cancel
              </button>
              <button type="submit" class="signupbtn">Sign Up</button>
            </div>
          </div>
        </form>
      </div>
    </div>

    <!-- Button to open the modal login form -->
    <button
      class="openbutton"
      onclick="document.getElementById('id01').style.display='block'"
    >
      Login
    </button>

    <!-- The Modal -->
    <div id="id01" class="modal" style="display: none;">
      <div class="w3-modal-content w3-animate-top">
        <span
          onclick="document.getElementById('id01').style.display='none'"
          class="close"
          title="Close Modal"
          >×</span
        >

        <!-- Modal Content -->
        <form action="Login.php" class="modal-content animate">
          <div class="imgcontainer">
            <img src="img_avatar2.png" class="avatar" height="42" width="42" />
          </div>

          <div class="container">
            <label for="uname"><b>Username</b></label>
            <input
              type="text"
              placeholder="Enter Username"
              name="uname"
              required=""
            />

            <label for="psw"><b>Password</b></label>
            <input
              type="password"
              placeholder="Enter Password"
              name="psw"
              required=""
            />

            <button type="submit">Login</button>
            <label>
              <input type="checkbox" checked="checked" name="remember" />
              Remember me
            </label>
          </div>

          <div class="container" style="background-color:#f1f1f1">
            <button
              type="button"
              onclick="document.getElementById('id01').style.display='none'"
              class="cancelbtn"
            >
              Cancel
            </button>
            <span class="psw">Forgot <a href="#">password?</a></span>
          </div>
        </form>
      </div>
    </div>
    <script>
      // Get the modal
      var modal = document.getElementById("id01");

      // When the user clicks anywhere outside of the modal, close it
      window.onclick = function(event) {
        if (event.target == modal) {
          modal.style.display = "none";
        }
      };
      // Get the modal
      var modal = document.getElementById("ido12");

      // When the user clicks anywhere outside of the modal, close it
      window.onclick = function(event) {
        if (event.target == modal) {
          modal.style.display = "none";
        }
      };
    </script>
  </div>
</body>

This is my form code. It pops up on a modal and i want the php to receive the user info and send it to the database for storing and retreiving.

I want to be able to run my mysql database in the terminal (ubuntu linux) and see the user info that has been submmited to the database and be able to retreive that when a user logs in to their account

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 目详情-五一模拟赛详情页
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b