KazuminEngine

プログラマーの日記

phpの予習

授業の予習を公開します

ここに書いてあることを理解すれば、楽勝です。

実際に実行してないので、動作保証はありません。

<table width=98%>
  <tr width=100% height="360px">
    <td width=50%>
      <form name="form1" action="sample.php" method="post">
        <table width="10">
          <tr width="10"><td width="85">サーバIP:</td><td><input type="text" name="txtA" size="15" ></td></tr>
          <tr width="10"><td width="85">回数:</td><td><input type="text" name="txtB" size="3"></td></tr>
          <tr width="10"><td width="85">ファイル名:</td><td><input type="text" name="txtC" size="10"></td></tr>
          <tr width="10"><td width="85"><input type="submit" value="計算"></td><td></td></tr>
      </form>
    </td>
  </tr>
  <tr>
    <td colspan=2>
      <div>
        <textarea name="hoge" rows="20" cols="90" value="てすと">ここに結果表示

       
        <?php
                $first = $_POST["txtA"];
                $seccond = $_POST["txtB"];
                $third = $_POST["txtB"];
                system("sh /var/www/html/sample/hoge.sh $first $seccond $third");
        ?>

        </textarea>
      </div>
    </td>
  </tr>
  </table>

わかったこと

  • 外部ファイルは、systemコマンドで実行できる。
  • post methodでpostできる。
  • 一つのフォームは、name属性がある。
  • フォームは、上から6行目ぐらい
  • postされたものは、$_POST["name"]で引ける。

注意

参考文献