| 第一個檔案:a.htm <form action='b.php' method=post> 大名<input type=text name='UserName' value='路人'><br> 族群 <select name='UserGroup'> <option>晨曦之鄉 <option>PHP同好會 <option>路過的人 </select><br> 對朝陽科技大學的感覺<br> <input type='checkbox' name='Feeling1' checked>很漂亮 <input type='checkbox' name='Feeling2'>很偏遠 <br> 留言 <textarea name='UserSay'>內容</textarea><br> <input type=submit value='確定'> <input type=reset value='取消'> </form> |
| 第二個檔案:b.php <?php echo "<br>你的大名是:".$UserName; echo "<br>你的族群是:".$UserGroup; echo "<br>你的留言是:".$UserSay; echo "<br>對朝陽科技大學的感覺:"; if (isset($Feeling1)) echo "很漂亮"; if (isset($Feeling2)) echo "很偏遠"; ?> |
| 結果: 你的大名是:路人 你的族群是:晨曦之鄉 你的留言是:內容 對朝陽科技大學的感覺:很漂亮 |
說明:
|
| 歡迎光臨 中央論壇 - CENTER BBS (https://centerbbs.com/) | Powered by Discuz! X3 |