亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

顯示提交的數據到日志時出現問題

顯示提交的數據到日志時出現問題

PHP
翻過高山走不出你 2022-12-23 13:05:39
<script>function login() {  var userN = document.getElementById("userN").value;  var pin = document.getElementById("pin").value;  if (userN == "") {    alert("User name not entered");    document.getElementById("userN").focus();    }    else if (pin == "") {      alert("PIN Number not entered");      document.getElementById("pin").focus();      }      else {        var userAccount = "User Name:" + userN + "\n" +          "Pin:" + pin;        alert("userAccount");      }    }  </script></head><body>  <h2>Please enter your User Name and PIN:</h2>  <form name="formLogin" action="">    <action="loginLog.php" method="post">    <p><label for="userN">User Name: </label>      <input type="text" name="userN" id="userN" size="20" maxlength="8" tabindex="1"></p>    <p><label for="pin">PIN Number: </label>      <input type="password" name="pin" id="pin" size="20" maxlength="8" tabindex="2"></p>    <input type="submit" onclick="return login();" />    <input type="reset" onclick="document.formLogin.userN.focus();" />  </form>我在使用 $_Post 捕獲和回顯以顯示在登錄頁面上提交的數據時遇到問題。我不確定在登錄頁面上獲取此數據以推送到 loginLog.php 我缺少什么這是我的 loginLog.php 文件<body>Welcome<?php    echo $_POST["userN"];?><?php    echo $_POST["pin"];?></body>
查看完整描述

1 回答

?
元芳怎么了

TA貢獻1798條經驗 獲得超7個贊

不要忘記添加method具有以下值的屬性post:


<form name="formLogin" action="path/to/yourfile/loginLog.php" method="post">

    <action="loginLog.php" method="post">

    <p><label for="userN">User Name: </label>

      <input type="text" name="userN" id="userN" size="20" maxlength="8" tabindex="1"></p>

    <p><label for="pin">PIN Number: </label>

      <input type="password" name="pin" id="pin" size="20" maxlength="8" tabindex="2"></p>


    <input type="submit" onclick="return login();" />

    <input type="reset" onclick="document.formLogin.userN.focus();" />

  </form>


查看完整回答
反對 回復 2022-12-23
  • 1 回答
  • 0 關注
  • 104 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號