[請益] 我是新手遇到難題

看板PHP作者 (上吧傑尼龜)時間17年前 (2008/06/19 20:31), 編輯推噓2(205)
留言7則, 4人參與, 最新討論串1/3 (看更多)
<html> <head> <title></title> </head> <body> <form action="Ch9-3-2.php" method="post"> <? $school=$_POST["school"]; switch ($school) { case "teacher": 學號:<input type="t1" name="User" size="20"><br> <br> 姓名 :<input type="t2" name="Pass" size="20"><br> <br> 資料庫 :<input type="t3" name="a" size="20"><br> <br> 系統分析:<input type="t4" name="b" size="20"><br> <br> LINUX :<input type="t5" name="c" size="20"><br> <br> PHP : <input type="t6" name="d" size="20"><br><br> <input type ="submit" value="老師登記"> break; case "student": 學號:<input type="t1" name="User" size="20"><br> <br> <input type ="submit" value="學生登入"> break; } ?> </form> </body> </html> 這是我的程式碼 跑不出來 我不懂錯在哪 有人可以教一下嗎 -- 老爹:"櫻木 你的優勢是什麼?" 櫻木:"帥氣的灌籃 臉蛋 全身上下都贏他" 老爹:"是你的速度和靈活度" http://www.wretch.cc/album/ashin65 我的拍賣 http://class.ruten.com.tw/user/index00.php?s=ashin65 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 192.83.195.222

06/19 20:47, , 1F
html & php code 沒分開
06/19 20:47, 1F

06/19 21:19, , 2F
那是要分成兩張嗎
06/19 21:19, 2F

06/19 21:21, , 3F
你這個code要讀$_POST,那你應該要用<form>來跑進去啊
06/19 21:21, 3F

06/19 21:22, , 4F
(如果你想用xx.php?school=teacher的話要讀$_GET['school'])
06/19 21:22, 4F

06/19 21:23, , 5F
啊等等,我發現問題不在這裡 囧
06/19 21:23, 5F

06/19 21:25, , 6F
我還有其他張,只是其他張都沒問題,只有這張怪怪的
06/19 21:25, 6F

07/10 12:36, , 7F
PHP的開頭是<?PHP 結尾是 ?> 你好像少了
07/10 12:36, 7F
文章代碼(AID): #18Mb6wCy (PHP)
討論串 (同標題文章)
文章代碼(AID): #18Mb6wCy (PHP)