[請益] 有關製作問卷的問題

看板PHP作者 (小背包)時間18年前 (2006/09/08 18:36), 編輯推噓0(007)
留言7則, 2人參與, 最新討論串1/1
大家好 我是php超級新手 想請教大家我做了一個線上問卷 目前只是要把網頁上使用者輸入的資料放到mysql的資料表中 但是出現了錯誤 我的第一個頁面的程式碼如以下 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "" rel="nofollow">http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <title>使用者滿意度問卷</title> <style type="text/css"> <!-- .style1 {font-family: "標楷體"} .style2 { color: #0000FF; font-weight: bold; font-size: 18px; font-family: "標楷體"; } .style3 {font-size: 16px} .style4 {font-size: 16px; font-family: "標楷體"; } --> </style> </head> <body> <form name="formsatis" method="POST" action="addsatis1.php"> <table width="779" height="241" border="0"> <tr> <td colspan="2"><div align="center"><span style='font-size:36.0pt; font-family:標楷體;color:black'><span class="style1">使用者滿意度問卷</span></span></div></td> </tr> <tr> <td colspan="2"><blockquote> <p align="justify" class="style2"> 本問卷的目的是幫助我們瞭解本教學資源網站之適用性。 本使用者滿意度問卷採用Likert氏四點量表,分為非常滿意、滿意、普通、不滿意及非常不滿意,非常感謝您的作答! </p> </blockquote></td> </tr> <tr> <td><div align="center"><span class="style3">1.</span></div></td> <td><select name="select1"> <option value="4">非常滿意</option> <option value="3">滿意</option> <option value="2">不滿意</option> <option value="1">非常不滿意</option> </select> <span class="style4">系統找出的教材符合我的需求</span></td> </tr> <tr> <td><div align="center"><span class="style3">2.</span></div></td> <td><select name="select2"> <option value="4">非常滿意</option> <option value="3">滿意</option> <option value="2">不滿意</option> <option value="1">非常不滿意</option> </select> <span class="style4">系統能呈現出我所需求的教材相關資訊 </span></td> </tr> <tr> <td><div align="center"><span class="style3">3.</span></div></td> <td><select name="select3"> <option value="4">非常滿意</option> <option value="3">滿意</option> <option value="2">不滿意</option> <option value="1">非常不滿意</option> </select> <span class="style4">我對系統找出教學資源的精確度感到滿意 </span></td> </tr> <tr> <td><div align="center"><span class="style3">4.</span></div></td> <td><select name="select4"> <option value="4">非常滿意</option> <option value="3">滿意</option> <option value="2">不滿意</option> <option value="1">非常不滿意</option> </select> <span class="style4">整體而言,此種推薦方式是有用的 </span></td> </tr> </table> <div align="center"> <input type="submit" name="submitsatic" value="送出"> <input type="reset" name="resetsatic" value="重新填寫"> </div> </form> </body> </html> 接下來是addsatis.php的程式碼 <?header("location:viewsatis.php);?> <?php include('db.php'); //匯入db.php檔案 /*接收表單資料*/ $select1=$_POST["T_select1"]; $select2=$_POST["select2"]; $select3=$_POST["select3"]; $select4=$_POST["select4"]; /*將欄位資料加入資料庫*/ $sql="INSERT satisfied (select1,select2,select3,select4) VALUES ('select1','select2','select3','select4')"; mysql_query($sql); ?> 但是當我填完問卷送出後出現了以下的錯誤 Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in c:\appserv\www\addsatis.php on line 5 想請教各位大大 我是哪個地方出錯了呢? 謝謝大家 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.71.133.99

09/08 20:23, , 1F
$select1=$_POST["T_select1"];<== T_select1?? select1吧
09/08 20:23, 1F

09/09 01:48, , 2F
不好意思...是我打錯了..但是我打正確的時候還是一樣的
09/09 01:48, 2F

09/09 01:49, , 3F
錯誤ㄝ...謝謝你...麻煩大家了...謝謝
09/09 01:49, 3F

09/09 10:47, , 4F
所以你 header("location:viewsatis.php"); 也是故意打錯的??
09/09 10:47, 4F

09/09 10:48, , 5F
^^^<==原本你少打"
09/09 10:48, 5F

09/09 22:40, , 6F
不是ㄟ..我不是故意的..請問正確的方法是如何呢??
09/09 22:40, 6F

09/09 22:45, , 7F
麻煩你了...謝謝y
09/09 22:45, 7F
文章代碼(AID): #150KV58i (PHP)