|
|
|
ช่วยดู Code ให้ผมหน่อยครับ มันเป็นอย่างนี้ * ทดสอบอ���กครั้ง * ต้องไปแก้ตรงไหน |
|
|
|
|
|
|
|
หน้าบอร์ดก็เป็นภาษาไทยปกติแต่พอคลิ๊กเข้าดูรายละเอียดกลับเป็นภาษาแบบนี้ * ทดสอบอ���กครั้ง * ช่วยด้วยครับมือใหม่
Code (PHP)
<?
include "sell_connect.php";
include "sell_function.php";
$id_ques=$_GET[id_ques];
///////////////// ส่วนที่ 1 /////////////////
$sql="select * from tb_question where id_ques='$id_ques' ";
$result=mysql_db_query($dbname,$sql);
$record=mysql_fetch_array($result);
$id_ques=$record[id_ques];
$title_ques=$record[title_ques];
$detail_ques=$record[detail_ques];
$name_ques=$record[name_ques];
$email_ques=$record[email_ques];
$date_ques=$record[date_ques];
$picboard=$record[pic];
$picboard2=$record[pic2];
$picboard3=$record[pic3];
$picboard4=$record[pic4];
$picboard5=$record[pic5];
$view_ques=$record[view_ques];
$post_ques=$record[post_ques];
$title_ques=htmlspecialchars($title_ques);
$detail_ques=nl2br(htmlspecialchars($detail_ques));
$name_ques=htmlspecialchars($name_ques);
$email_ques=htmlspecialchars($email_ques);
$ip=$record[$ip];
//$date_ques=displaydate($date_ques);
$pic="<IMG SRC='images/smile.gif'>";
$detail_ques=str_replace(":)",$pic, $detail_ques);
$pic="<IMG SRC='images/open_mouthed_smile.gif'>";
$detail_ques=str_replace(":D",$pic, $detail_ques);
$pic="<IMG SRC='images/winking_smile.gif'>";
$detail_ques=str_replace(";)",$pic, $detail_ques);
$pic="<IMG SRC='images/sursprised_smile.gif'>";
$detail_ques=str_replace(":-O",$pic, $detail_ques);
$pic="<IMG SRC='images/smile_with_tongue_out.gif'>";
$detail_ques=str_replace(":P",$pic, $detail_ques);
$pic="<IMG SRC='images/hot_smile.gif'>";
$detail_ques=str_replace("(H)",$pic, $detail_ques);
$pic="<IMG SRC='images/angry_smile.gif'>";
$detail_ques=str_replace(":@",$pic, $detail_ques);
$pic="<IMG SRC='images/confused_smile.gif'>";
$detail_ques=str_replace(":S",$pic, $detail_ques);
$pic="<IMG SRC='images/embarrassed_smile.gif'>";
$detail_ques=str_replace(":$",$pic, $detail_ques);
$pic="<IMG SRC='images/sad_smile.gif'>";
$detail_ans=str_replace(":(",$pic, $detail_ques);
$sql = "UPDATE tb_question SET view_ques = view_ques + 1
WHERE id_ques = $id_ques;";
@mysql_query($sql) or die(mysql_error());
$text = $title_ques;
$title_ques = wordwrap($text, 20, "\n", 1);
$text2 = $detail_ques;
$detail_ques = wordwrap($text2, 30, "\n", 1);
if ($picboard==""){
}
else { echo " <img src=photosell/$picboard><br><hr> ";
}
if ($picboard2==""){
}
else { echo " <img src=photosell/$picboard2><br><hr> ";
}
if ($picboard3==""){
}
else { echo " <img src=photosell/$picboard3><br><hr> ";
}
if ($picboard4==""){
}
else { echo " <img src=photosell/$picboard4><br><hr> ";
}
if ($picboard5==""){
}
else { echo " <img src=photosell/$picboard5><br><hr> ";
}
echo "
<h2>$title_ques</h2>
<table width=670' border='0'>
<tr>
<td bgcolor='#FFFFFF'><br>
<font size='2' face='Tahoma'>
<center>
$detail_ques</center>
<p><b>โดย :</b> $name_ques <img src=logo/ip.jpg> $ip
<img width=18 height=18 src=logo/view.jpg />view<align=center> $view_ques
<img width=15 height=15 src=logo/comment.gif />post<align=center> $post_ques
<b>เมื่อ :</b> $date_ques
<a href='sell_question_del.php?id_ques=$id_ques'> [ Delete ] </a><a href='sell_question_del.php?id_ques=$id_ques'> [ แก้ไข ] </a></p></font></td>
</tr>
</table>";
///////////////// ส่วนที่ 2 /////////////////
$sql="select * from tb_answer where ref_id='$id_ques' order by id_ans";
$result=mysql_db_query($dbname,$sql);
while($record=mysql_fetch_array($result)) {
$id_ans=$record[id_ans];
$detail_ans=$record[detail_ans];
$name_ans=$record[name_ans];
$email_ans=$record[email_ans];
$date_ans=$record[date_ans];
$ref_id=$record[ref_id];
$ip_ans=$record[ip_ans];
$detail_ans=nl2br(htmlspecialchars($detail_ans));
$name_ans=htmlspecialchars($name_ans);
$email_ans=htmlspecialchars($email_ans);
//$date_ans=displaydate($date_ans);
$pic="<IMG SRC='images/smile.gif'>";
$detail_ans=str_replace(":)",$pic, $detail_ans);
$pic="<IMG SRC='images/open_mouthed_smile.gif'>";
$detail_ans=str_replace(":D",$pic, $detail_ans);
$pic="<IMG SRC='images/winking_smile.gif'>";
$detail_ans=str_replace(";)",$pic, $detail_ans);
$pic="<IMG SRC='images/sursprised_smile.gif'>";
$detail_ans=str_replace(":-O",$pic, $detail_ans);
$pic="<IMG SRC='images/smile_with_tongue_out.gif'>";
$detail_ans=str_replace(":P",$pic, $detail_ans);
$pic="<IMG SRC='images/hot_smile.gif'>";
$detail_ans=str_replace("(H)",$pic, $detail_ans);
$pic="<IMG SRC='images/angry_smile.gif'>";
$detail_ans=str_replace(":@",$pic, $detail_ans);
$pic="<IMG SRC='images/confused_smile.gif'>";
$detail_ans=str_replace(":S",$pic, $detail_ans);
$pic="<IMG SRC='images/embarrassed_smile.gif'>";
$detail_ans=str_replace(":$",$pic, $detail_ans);
$pic="<IMG SRC='images/sad_smile.gif'>";
$detail_ans=str_replace(":(",$pic, $detail_ans);
echo "
<table width=670' border='0'>
<tr>
<td bgcolor='#FFFFFF'><div class='mixcode'><font size='2' face='MS Sans Serif'>$detail_ans</font></td>
</tr>
<tr>
<td bgcolor='#FFFFFF'><font size='2' face='Tahoma'>
ลําดับที่ : <img src=logo/post.jpg> ตอบโดย : $name_ans <img src=logo/ip.jpg> $ip_ans เมื่อ : $date_ans
<a href='sell_answer_del.php?&id_ques=$id_ques&id_ans=$id_ans'> [ Delete ] </a></div> <right><img src=logo/ip.gif>
บรรทึกการเข้า</right></font> </td>
</tr>
</table>";
} //end while
mysql_close($c);
///////////////// ส่วนที่ 3 /////////////////
?>
Tag : PHP
|
|
|
|
|
|
Date :
2011-07-08 22:49:53 |
By :
khwan |
View :
17982 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตั้งค่าในโปรแกรมที่ใช้เขียน,ตั้งค่าภาษาในcode,ตั้งค่าในฐานข้อมูลในเป็นtis620_thai_ci
|
|
|
|
|
Date :
2011-07-10 15:19:23 |
By :
มาม่า |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตามที่เป๋าตุงบอกเลยค่ะ
|
|
|
|
|
Date :
2011-07-11 02:03:14 |
By :
modzaa07 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|