溫瑞烘老師的教學歷程檔案(Teaching ePortfolio) - 資管三甲乙資料庫系統教學資源區 - 99-2-第一週(2) type=text練習
 

資訊管理系
副教授
温瑞烘


歷程檔案 Portfolio


關於我 About Me

99-2-第一週(2) type=text練習

<?php
  $PHP_SELF=$_SERVER["PHP_SELF"];
  $command=$_POST['command']; // 取出變數值
  if ($command==null) {       // 空值, 未經由form傳送     
    echo "<html>";
    echo "<body>";
    echo "<center>";
    echo "<form method=post action=$PHP_SELF>";
    echo "班級:";
    echo "<input type=text name=depart_class size=10>";
    echo "<p>";
    echo "<input type=submit name=command value=送出>";
    echo "<input type=reset  name=command value=清除>";
    echo "</form>";
    echo "</center>";
    echo "</body>";
    echo "</html>";
  }
  else if ($command=='送出') {
    $depart_class=$_POST["depart_class"];
    echo "<html>";
    echo "<body>";
    echo "<center>";
    echo "<form method=post action=$PHP_SELF>";
    echo "班級:";
    echo "<input type=text name=depart_class size=10 value='$depart_class'>";
    echo "<p>";
    echo "<input type=submit name=command value=送出>";
    echo "<input type=reset  name=command value=清除>";
    echo "</form>";
    echo "</center>";
    echo "</body>";
    echo "</html>";
  }
?>

 

參考前述範例,改寫程式使第二個畫面和第一個畫面一樣,但顯式輸入的值


 

全部共 1則留言
02-24 19:31:除了上述輸入的值,第二組請問還要再+甚麼?
登入帳號密碼代表遵守學術網路規範
 


文章分類 Labels

 


最新文章 Top10

中華科技大學數位化學習歷程 - 意見反應