diff --git a/Question10-class/Ex03.php b/Question10-class/Ex03.php index 516270f..9c43e08 100644 --- a/Question10-class/Ex03.php +++ b/Question10-class/Ex03.php @@ -16,3 +16,27 @@ * 6. 最後に、$us の各プロパティの値を出力してください。 * */ +// require_onceを使い、User.php を読み込んでください。 +require_once __DIR__. '/User.php'; + +// 前画面からPOSTで送信された以下のデータを、それぞれ変数に格納 +// それぞれ変数として格納 + $user_id = $_POST['user_id']; + $user_name = $_POST['user_name']; + $mail = $_POST['mail']; + $password = $_POST['password']; + +// 変数 $us を宣言し、User クラスのインスタンスを生成して代入してください。 +$us = new User (); + +// 取得した各値を、$us の +// 各プロパティ(user_id, user_name, mail, password)に代入してください。 + +// $usのプロパティに変数を用いて代入する +$us ->user_id = $user_id; +$us ->user_name = $user_name; +$us ->mail = $mail; +$us ->password = $password; + +// 最後に、$us の各プロパティの値を出力してください。 +$us ->say(); \ No newline at end of file