phpで、入力画面を作ったのですが、[戻る]という表示項目が余計に一つ出ているバグが起きています。
表示結果
php
1<html> 2 <head> 3 <meta http-equiv="content-type" charset="utf-8"> 4 </head> 5 6 7 <body> 8 9 <?php 10 $nickname=$_POST["nickname"]; 11 $email=$_POST["email"]; 12 $goiken=$_POST["goiken"]; 13 14 if($nickname=="") 15 { 16 print"ニックネームが入力されていません。<br>"; 17 } 18 else 19 { 20 print"ようこそ"; 21 print $nickname; 22 print"様"; 23 print"<br>"; 24 } 25 26 if($email=="") 27 { 28 print"メールアドレスが入力されていません。<br>"; 29 } 30 else 31 { 32 print"メールアドレス:"; 33 print$email; 34 print"<br>"; 35 } 36 37 if($goiken=="") 38{ 39 print"ご意見が入力されていません。<br>"; 40} 41else 42{ 43 print"ご意見『"; 44 print $goiken; 45 print"』<br>"; 46} 47 48if( $nickname=''||$email==''||$goiken=='') 49{ 50 print'<form>'; 51 print'<input type="button" onclick="history.back()" value="戻る">'; 52 print'</form>'; 53} 54 print'<form method="post" action="thanks.php">'; 55 print'<input type="button" onclick="history.back()" value="戻る">'; 56 print'<input type="submit" value="OK">'; 57 print"</form>"; 58?> 59 60 </body> 61</html>
回答2件
あなたの回答
tips
プレビュー