session_start();
?>
BaanThai: My answer form
Baan Thai Cooking School:
F A Q
[ all question about the course ]
// $mypermission = 5;
$mypermission = $_SESSION["mypermission"];
$no = $_GET["no"];
if($mypermission < 5) {
die ("You have no right to enter this page");
}
include($_SERVER['DOCUMENT_ROOT'] . "/incl/sc.php");
$SQL = "SELECT no, name, email, country, city, question, answer, stamp FROM qa WHERE no = $no";
// $SQL = "SELECT * FROM qa ORDER BY no";
$table = mysql_query($SQL,$Conn) or die ("Unable to read table QA");
$row = mysql_fetch_array($table);
print("");
$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_question = ereg_replace(" " ," " , $r_question);
//�ŧ���� ASCII �ͧ��â�鹺�÷Ѵ����
//�������
᷹
$r_question = ereg_replace(chr(13) ,"
" , $r_question);
// show each question and answer
print "";
print "No : $r_no
";
print "Q: $r_question
";
print "From: $r_name $r_country/$r_city <$r_email> $r_stamp
";
print " |
";
print "
";
include("EndConnect.inc");
?>