-
-
Save chocotaro/32c4d3c15752540c136771cd51310b17 to your computer and use it in GitHub Desktop.
出力用:非表示(output.php)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //データの受け取り | |
| //項目追加の場合は配列の要素を $_POST["項目名"] で追加する | |
| $data = array($_POST["year"], $_POST["month"],$_POST["kihon"],$_POST["jyuryo"],$_POST["genryo"]); | |
| //データを区切る為の文字、通常はカンマ指定 | |
| $c = ","; | |
| //受け取ったデータを区切り文字入りで1つの文字列にまとめる | |
| $str = implode($c, $data); | |
| //データを書き込む為のファイルを開く | |
| $file = fopen("data.txt", "w"); | |
| //データの書き込み作業 ※"\n"は改行です | |
| fwrite($file, $str."\n"); | |
| //ファイルを閉じる | |
| fclose($file); | |
| //ページの遷移(editディレクトリにすべてのファイルが入っている前提。hogehge.jpは任意のURLに変更) | |
| header("Location:https://hogehoge.jp/edit/success.php"); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment