Warning: include_once(/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/top_msg.php): failed to open stream: No such file or directory in /home/users/2/moriya-h5/web/confrage/php/confirmation/contents/contents.php on line 20
Warning: include_once(): Failed opening '/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/top_msg.php' for inclusion (include_path='.:/usr/local/php/7.4/lib/php') in /home/users/2/moriya-h5/web/confrage/php/confirmation/contents/contents.php on line 20
目次 |
---|
・内容確認 ・サンプルコード ・サンプル |
(php部) <?php print "<font color='black'>テキストデータが適切でない場合は、エラーが表示されます。↓"; // 「送信」ボタンが押された時 if (isset($_POST[btnExec])) { if ( !ereg("http://",$_POST[memo]) ) { print ""<font color='red'>※テキストボックスはhttp://から入力してください。"</color>"; } } print ""<font color='black'>テキスト未入力時にエラーが表示されます。↓"; // 「送信」ボタンが押された時 if (isset($_POST[btnExec])) { if ( strlen($_POST[memo]) == 0 ) { print ""<font color='red'>※テキストボックスが未入力です。"</color>"; } } print ""<font color='black'>リスト未選択時にエラーが表示されます。↓"; // 「送信」ボタンが押された時 if (isset($_POST[btnExec])) { if ( !isset($_POST[kind]) ) { print ""<font color='red'>※リストが未選択です。"</color>"; } } ?>
(html部) <form method="post"> <input type="text" name="memo" size="50"> <select size="2" name="kind"> <option value="homepage">ホームページ</option> <option value="blog">ブログ</option> </select> <input type="submit" name="btnExec" value="送信"> </form>