2025-03-24

PHP中代碼

  1.  
  2. <?php   
  3. $test = $_POST[ test ];   
  4. echo 12 ;   
  5. echo $test;   
  6. echo $_POST[ submit1 ];   
  7. echo $_POST[ submit2 ];   
  8. if (isset($_POST[ submit1 ]) && $_POST[ submit1 ] == submit1 )   
  9. {   
  10. echo ok1 ;   
  11. }   
  12. if (isset($_POST[ submit2 ]) && $_POST[ submit2 ] == submit2 )   
  13. {   
  14. // echo " <meta http-equiv=refresh content= 0; url=https://localhost:8000/php/index.php > ";   
  15. // header( "Location:index.php ");   
  16. // break;   
  17. echo ok2 ;   
  18. }   
  19. ?>  

HTML代碼

  1. <html>   
  2. <head> </head>   
  3. <body>   
  4. <form action= xajaxtest.php  method= POST >   
  5. <input type= hidden  name= test  value= test1 >   
  6. <input name= submit1  type= submit  value= submit1  title= submit1 >   
  7. <input name= submit2  type= submit  value= submit2  title= submit2 >   
  8. </form>   
  9. </body>   
  10. </html>   
  11. 為什麼 這個測試頁面 載入後第一次不傳數據?   
  12. echo $_POST[ submit1 ];echo $_POST[ submit2 ];都打印空   
  13. 之後就好瞭。這個是什麼原因 有沒有辦法解決?   
  14. 方法二:   
  15. <script language= "JavaScript "><!--   
  16. function check(){   
  17. frm.action = "checkname.php "   
  18. }   
  19. function mysubmit() {   
  20. frm.action = "zhuce.php "   
  21. }   
  22. // --></script>   
  23. <form method=post action= " " name= "frm ">   
  24. <input type= "submit " onclick=&

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *