2017-01-03 45 views
0

我想通過POST方法將我的表單數據發送到另一個頁面,以便在我的指定部分加載聚焦其他頁面。我該怎麼做?如何在提交表單數據後轉移到另一頁的部分?

<form method="post" id="loginForm" action="/index.php"> 
 
     <table> 
 
     <tr> 
 
      <td><label class="labelShadow">User Name: </label></td> 
 
      <td><input type="text" name="uName" class="loginBox" value="<?php if(isset($_COOKIE['uName']))echo $_COOKIE['uName']; ?>" /></td> 
 
     </tr> 
 
     <tr> 
 
      <td><label class="labelShadow">Password: </label></td> 
 
      <td><input type="password" name="pass" class="loginBox" value="<?php if(isset($_COOKIE['pass']))echo $_COOKIE['pass']; ?>" /></td> 
 
     </tr> 
 
     <tr> 
 
      <td colspan="2" style="text-align:center"> 
 
      <input type="submit" value="Login" name="login" class="btn btn-default" <?php callRouter(); if(isset($_SESSION['privilege']))echo "disabled"; ?>/> 
 
      <input type="checkbox" class="checkBoxShodow" name="cookieChk" <?php if(isset($_COOKIE['pass']))echo "checked"; ?> /> 
 
      <label class="labelShadow">&nbsp;remember me</label> 
 
      </td> 
 
     </tr> 
 
     </table> 
 
    </form>

+1

您介意rephrasi你的問題很難理解。 – meji

回答

1

如果我理解正確的問題,你只需要一個錨添加到窗體的行動,像這樣:

<form method="post" id="loginForm" action="/index.php#focus-on-section"> 

錨可以是任何元素與id在您的其他頁面上:

<div id="focus-on-section"> 
    more stuff 
</div> 
相關問題