■
簡単なメールフォーム作り
<!DOCTYPE html> <html lang="ja"> <head> <mata charset="UTF-8"> <title>お問い合わせ入力フォーム</title> <link href="css/style.css" rel="stylesheet" media="screen, print"> </head> <body> <form action="check.php" method="post" id="inquiry"> <table summary="お問い合わせに関する入力項目名とその入力欄"> <tr> <th><label for="name">お名前</label></th> <td><input type="text" name="name" size="30" id="name" class="text1"></td> </tr> <tr> <th><label for="email">メールアドレス</label></th> <td><input type="text" name="email" size="30" id="email" class="text2"></td> </tr> <tr> <th><label for="message">ご意見</label></th> <td><textarea name="message" cols="30" rows="5" class="text3" id="message"></textarea></td> </tr> </table> <input type="submit" value="確認画面へ"> </form> </body> </html>
縦線を入れるCSS
@charset "UTF-8"; body{ font-size: 1.0em; font-family: sans-serif; line-height: 1.5; color: #333333; background-color: #FFFFFF; } #inquiry{ width: 600px;/*ボックスの幅を指定*/ padding: 2px 0 2px 20px; border-left: 5px #C30 solid; } th{ text-align: right; }
<!DOCTYPE html> <html lang="ja"> <head> <mata charset="UTF-8"> <title>確認画面</title> <link href="css/style.css" rel="stylesheet" media="screen, print"> </head> <body> <?php $name = $_POST['name']; if($name=='') { echo 'お名前を入力されていません。'; }else{ echo 'ようこそ、'.$name.'様'; } ?> </body> </html>