session_start(); ?>
include("../mainmenu.php"); ?>
|
include($_SERVER['DOCUMENT_ROOT'] . "/incl/sc.php"); $mypermission = $_SESSION["mypermission"]; $SQL = "SELECT no, question FROM qa ORDER BY no"; $table = mysql_query($SQL,$Conn) or die ("Unable to read table QA"); print "
"; $SQL = "SELECT * FROM qa ORDER BY no"; $table = mysql_query($SQL,$Conn) or die ("Unable to read table QA"); while($row = mysql_fetch_array($table)) { $r_no = $row["no"]; $r_name = $row["name"]; $r_email = htmlspecialchars($row["email"]); $r_country = $row["country"]; $r_city = $row["city"]; $r_stamp = $row["stamp"]; //แปลงข้อมูลที่ผู้แสดงความคิดเห็นกรอกให้สามารถ //แสดงเครื่องหมายพิเศษในภาษา HTML $r_question = htmlspecialchars($row["question"]); $r_answer = htmlspecialchars($row["answer"]); // use the wordwrap to prevent text over table $r_question = wordwrap( $r_question, 80 ); $r_answer = wordwrap( $r_answer, 80 ); //แปลงช่องว่างที่แสดงความคิดเห็นกรรอกให้เป็น $r_question = str_replace(" " ," " , $r_question); $r_answer = str_replace(" " ," " , $r_answer); //แปลงรหัส ASCII ของการขึ้นบรรทัดใหม่ //ให้เป็นแท็ก แทน $r_question = str_replace(chr(13) ," " , $r_question); $r_answer = str_replace(chr(13) ," " , $r_answer); // show each question and answer print ""; print("
"; } include("EndConnect.inc"); ?> |