|
|
|
ติดปัญหาการสร้างWebboardค่ะรบกวนพี่ๆด้วยค่ะขอบคุณค่ะ |
|
|
|
|
|
|
|
ถามมาแต่ไม่มีโค้ดมาดู ไม่รู้จะช่วยแก้ยังไงครับ
เรื่องภาษาไทยก็เกี่ยวกับการ encode ครับ
|
|
|
|
|
Date :
2011-01-08 17:34:50 |
By :
narubet |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
***b_frmPostMessage.php
<?php
session_start();
ob_start();
if( $_SESSION["authen"] == "false" or $_SESSION["authen"] == NULL){
header("Location: login.php");
}
include("includes/a.php");
include("includes/extra.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>+++ แบบฟอร์มการตั้งกระทู้ใหม่ +++ </title>
</style>
<center>
<table width="980" cellspacing="0" cellpadding="0" leftmargin="0" topmargin="0" background="pic/toppage.gif" class="headertext">
<tr>
<td width="1024"><img src="pic/toppage.jpg" width="1024"></td>
</tr>
</table>
</center>
<table width="1024" cellspacing="0" cellpadding="0" leftmargin="0" topmargin="0" border="0" background="pic/mm.jpg">
<marquee scrollamount=2 onMouseOut=start(); onMouseOver=stop(); ><?php include("includes/tdate.php"); ?>
</font>
</td>
</tr>
<tr>
<td width="209" valign="top">
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="includes/style.css" rel="stylesheet" type="text/css">
<?php
include("includes/left_page.php");
?>
<!--mindle-->
</td>
<td width="606" valign="top">
<table width="606" cellspacing="0" cellpadding="0" background="pic/mm.jpg">
<tr height="10" >
<td width="12" background="pic/lu.jpg"></td>
<td width="582" align="center" background="pic/mu.jpg"></td>
<td width="12" background="pic/ru.jpg"></td>
</tr>
<form action="b_PostMessage.php" method="post">
<tr height="24">
<td background="pic/lm.jpg"> </td>
<td align="center" background="pic/mm.jpg" valign="bottom" class="boldtext">
<img src="pic/pin.png" border="0"> +++ แบบฟอร์มการตั้งกระทู้ใหม่ +++ <img src="pic/pin.png" border="0">
<hr width="95%">
<table width="580" class="boldtext">
<tr>
<td align="center" class="boldtext">
<tr>
<td width="25%" align="right">หัวข้อกระทู้ : </td>
<td width="75%"><INPUT TYPE="text" NAME="subject" size="50" maxlength="150" class="boldtext"></td>
</tr>
<tr>
<td width="25%" align="right" valign="top">รายละเอียดกระทู้ : </td>
<td width="75%"><TEXTAREA NAME="detail" ROWS="6" COLS="50" class="boldtext"></TEXTAREA></td>
</tr>
<tr>
<td width="25%" align="right">ชื่อผู้ตั้งกระทู้ : </td>
<td width="75%"><INPUT TYPE="text" NAME="name" size="30" maxlength="50" class="boldtext"></td>
</tr>
<tr>
<td width="25%" align="right">อีเมล์ : </td>
<td width="75%"><INPUT TYPE="text" NAME="email" size="30" maxlength="50" class="boldtext"></td>
</tr>
<tr>
<td width="25%" align="right"><img src="captcha.php" alt="captcha image"></td>
<td width="75%"><input type="text" name="captcha" size="3" maxlength="3"> (Please type 3 black character)</td>
</tr>
<tr>
<td colspan="2" align="center"> <hr width="90%"></td>
</tr>
<tr>
<td width="25%" align="right"> </td>
<td width="75%"><INPUT TYPE="submit"value=" ตั้งกระทู้ใหม่ "></td>
</tr>
</table>
</form>
</td>
<td background="pic/rm.jpg"> </td>
</tr>
<tr height="14">
<td background="pic/lb.jpg"></td>
<td align="center" background="pic/mb.jpg"></td>
<td background="pic/rb.jpg"></td>
</tr>
</table>
</center>
</td>
<td width="209" valign="top">
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="includes/style.css" rel="stylesheet" type="text/css">
Code (PHP)
***b_openMessage.php
<?php
session_start();
ob_start();
if( $_SESSION["authen"] == "false" or $_SESSION["authen"] == NULL){
header("Location: login.php");
}
include("includes/a.php");
include("includes/extra.php");
// include("header.php");
$no=$_GET["no"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</style>
<center>
<table width="980" cellspacing="0" cellpadding="0" leftmargin="0" topmargin="0" background="pic/toppage.gif" class="headertext">
<tr>
<td width="1024"><img src="pic/toppage.jpg" width="1024"></td>
</tr>
</table>
</center>
<table width="1024" cellspacing="0" cellpadding="0" leftmargin="0" topmargin="0" border="0" background="pic/mm.jpg">
<marquee scrollamount=2 onMouseOut=start(); onMouseOver=stop(); ><?php include("includes/tdate.php"); ?>
</font>
</td>
</tr>
<tr>
<td width="209" valign="top">
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="includes/style.css" rel="stylesheet" type="text/css">
<?php
include("includes/left_page.php");
?>
</td>
<td width="606" valign="top">
<table width="606" cellspacing="0" cellpadding="0" background="pic/mm.jpg">
<tr height="10" >
<td width="12" background="pic/lu.jpg"></td>
<td width="582" align="center" background="pic/mu.jpg"></td>
<td width="12" background="pic/ru.jpg"></td>
</tr>
<tr height="24">
<td background="pic/lm.jpg"> </td>
<td align="center" background="pic/mm.jpg" valign="bottom" class="boldtext">
<img src="pic/transmit.png" border="0"> +++ กระดานข่าว : +++<img src="pic/transmit.png" border="0">
<hr width="95%">
<?php
include("includes/connectdb.php");
$link=mysql_connect($hostname, $username, $password);
if ($link) {
mysql_select_db($dbname);
mysql_query("SET NAMES UTF8");
$sql="update webboard set counter=counter+1 where no=$no";
mysql_query($sql);
$sql="select * from webboard where no=$no";
include("includes/mycharset.php");
$table=mysql_query($sql) or die (" ไม่สามารถเรียกดูข้อมูลในตารางได้ ");
if ($row =mysql_fetch_array($table)) {
$r_ipaddress=$row["ipaddress"];
$r_stamp = $row["stamp"];
$r_subject = htmlspecialchars($row["subject"]);
$r_detail = htmlspecialchars($row["detail"]);
$r_name = htmlspecialchars($row["name"]);
$r_email = htmlspecialchars($row["email"]);
$r_subject = ereg_replace(" ", " ", $r_subject);
$r_name = ereg_replace(" ", " ", $r_name);
$r_email=ereg_replace(" ", " ", $r_email);
$r_detail=ereg_replace(" ", " ", $r_detail);
$r_detail=ereg_replace(chr(13), "<br>", $r_detail);
}
}
?>
<table class="boldtext" width="590">
<tr height="29">
<td align="center" > +++ แสดงกระทู้ : +++<br></td>
</tr>
<tr>
<td align="center">##### กระทู้ที่ ==> <?php print "$no"; ?> #####<hr></td>
</tr>
<tr>
<td>
<table width="95%" border="1" class="normaltext" bgcolor="">
<tr>
<td>
<table width="98%" class="normaltext">
<tr>
<td class="boldtext">
<?php print "$r_subject"; ?>
</td>
</tr>
<tr>
<td>
<?php print "<br>$r_detail<br><br>"; ?>
</td>
</tr>
<?php
if ($r_email=='')
{
print "<tr>";
print "<td>";
print "จากคุณ : <B>$r_name</B> เมื่อวันที่ : <b>$r_stamp</b> [$r_ipaddress]";
print "</td>";
print "</tr>";
} else {
print "<tr>";
print "<td>";
print "จากคุณ : <B>$r_name</B> <b><a href =mailto:$r_email><img src = pic/email.gif border=0 height=20></a></b> เมื่อวันที่ : <b>$r_stamp</b> [$r_ipaddress]";
print "</td>";
print "</tr>";
}
?>
</table>
</td>
</tr>
</table>
</td>
</tr>
<?php
include("includes/connectdb.php");
$link=mysql_connect($hostname, $username, $password);
if ($link) {
mysql_select_db($dbname);
mysql_query("SET NAMES UTF8");
$sql="select * from webboarddetail where no=$no order by commentno";
include("includes/mycharset.php");
$table=mysql_query($sql) or die(" ไม่สามารถเรียกดูข้อมูลได้ ");
$bg="#FF0000";
while ($row=mysql_fetch_array($table)) {
$r_commentno=$row['commentno'];
$r_commentipaddress=$row['commentipaddress'];
$r_commentstamp=$row['commentstamp'];
$r_commentdetail=$row['commentdetail'];
$r_commentname=$row['commentname'];
$r_commentemail=$row['commentemail'];
$r_commentname = ereg_replace(" ", " ", $r_commentname);
$r_commentemail = ereg_replace(" ", " ", $r_commentemail);
$r_commentdetail = ereg_replace(" ", " ", $r_commentdetail);
$r_commentdetail =ereg_replace(chr(13), "<br>", $r_commentdetail);
print "<tr>";
print "<td align=right>";
print "<table width=90% border=1 class=normaltext bgcolor=>";
print "<tr><td>";
print "<table width=98% class=normaltext>";
print "<tr><td class=boldtext>";
print "ความคิดเห็นที่ : $r_commentno";
print "</td></tr>";
print "<tr><td class=normaltext>";
print "<br>$r_commentdetail<br><br>";
print "</td></tr>";
if ($r_email=='')
{
print "<tr>";
print "<td>";
print "จากคุณ : <B>$r_commentname</B> เมื่อวันที่ : <b>$r_commentstamp</b> [$r_commentipaddress]";
print "</td>";
print "</tr>";
} else {
print "<tr>";
print "<td>";
print "จากคุณ : <B>$r_commentname</B> <b><a href=mailto:$r_commentemail><IMG SRC=pic/email.gif border=0 height=20></a></b> เมื่อวันที่ : <b>$r_commentstamp</b>";
print "</td>";
print "</tr>";
}
print "</table>";
print "</td></tr>";
print "</table>";
print "</td>";
print "</tr>";
}
}
?>
<tr>
<td align="center"><hr></td>
</tr>
<!-- สำหรับส่วนที่แสดงความคิดเห็น -->
<tr>
<td align="center">
<!-- กรอบแสดงความคิดเห็น -->
<FORM method="post" ACTION="b_PostComment.php">
<table width="90%" border="1" class="boldtext">
<tr height="29">
<td bgcolor="" colspan="2" align="center"> +++ ร่วมแสดงความคิดเห็น +++</td>
</tr>
<tr>
<td width="25%" align="right" valign="top">ความคิดเห็น : </td>
<td width="75%"><TEXTAREA NAME="commentdetail" ROWS="6" COLS="50" class="boldtext"></TEXTAREA></td>
</tr>
<tr>
<td width="25%" align="right">ชื่อผู้ออกความคิดเห็น : </td>
<td width="75%"><INPUT TYPE="text" NAME="commentname" size="30" maxlength="50" class="boldtext"></td>
</tr>
<tr>
<td width="25%" align="right">อีเมล์ : </td>
<td width="75%"><INPUT TYPE="text" NAME="commentemail" size="30" maxlength="50" class="boldtext"><input type="hidden" name="no" value="<?php print "$no"; ?>"></td>
</tr>
<tr>
<td width="25%" align="right"><img src="captcha.php" alt="captcha image"></td>
<td width="75%"><input type="text" name="captcha" size="3" maxlength="3"> (Please type 3 black character)</td>
</tr>
<tr>
<td colspan="2" align="center"><INPUT TYPE="submit"value=" ร่วมแสดงความคิดเห็น "></td>
</tr>
</table>
</FORM>
</td>
</tr>
</table>
</td>
<?php
mysql_close($link);
// include("right.php");
?>
</td>
<td background="pic/rm.jpg"> </td>
</tr>
<tr height="14">
<td background="pic/lb.jpg"></td>
<td align="center" background="pic/mb.jpg"></td>
<td background="pic/rb.jpg"></td>
</tr>
</table>
</center>
</td>
<td width="209" valign="top">
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="includes/style.css" rel="stylesheet" type="text/css">
Code (PHP)
**b_PostComment.php
<?php
session_start();
ob_start();
if( $_SESSION["authen"] == "false" or $_SESSION["authen"] == NULL){
header("Location: login.php");
}
include("includes/a.php");
include("includes/extra.php");
// include("header.php");
include("includes/connectdb.php");
$commentdetail = $_POST['commentdetail'];
$commentname = $_POST['commentname'];
$commentemail = $_POST['commentemail'];
$no = $_POST['no'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> +++ กระดานข่าว -- +++ </title>
</style>
<center>
<table width="980" cellspacing="0" cellpadding="0" leftmargin="0" topmargin="0" background="pic/toppage.gif" class="headertext">
<tr>
<td width="1024"><img src="pic/toppage.jpg" width="1024"></td>
</tr>
</table>
</center>
<table width="1024" cellspacing="0" cellpadding="0" leftmargin="0" topmargin="0" border="0" background="pic/mm.jpg">
<marquee scrollamount=2 onMouseOut=start(); onMouseOver=stop(); ><?php include("includes/tdate.php"); ?>
</font>
</td>
</tr>
<tr>
<td width="209" valign="top">
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="includes/style.css" rel="stylesheet" type="text/css">
<?php
include("includes/left_page.php");
?>
</td>
<td width="606" valign="top">
<table width="606" cellspacing="0" cellpadding="0" background="pic/mm.jpg">
<tr height="10" >
<td width="12" background="pic/lu.jpg"></td>
<td width="582" align="center" background="pic/mu.jpg"></td>
<td width="12" background="pic/ru.jpg"></td>
</tr>
<tr height="24">
<td background="pic/lm.jpg"> </td>
<td align="center" background="pic/mm.jpg" valign="bottom" class="boldtext">
<img src="pic/transmit.png" border="0"> +++ กระดานข่าว : img src="pic/transmit.png" border="0">
<hr width="95%">
<?php
if(isset($_POST["captcha"]))
if($_SESSION["captcha"]==$_POST["captcha"])
{
//CAPTHCA is valid; proceed the message: save to database, send by e-mail ...
// echo 'CAPTHCA is correct!!! your data will add to database';
?>
<center>
<table width="580" cellspacing="0" cellpadding="0" leftmargin="0" topmargin="0" border="0" class="normaltext">
<tr height="29">
<td colspan="3" class="boldtext">
<!-- <font color="#FF00FF">
<marquee scrollamount=2
</td>
</tr>
<tr>
<td width="194" valign="top">
<!-- </td> -->
<td width="582" valign="top">
<?php
if($commentdetail<>"" and $commentname<>"")
{
//หัวข้อกระทู้ยาวไม่เกิน 150 ตัวอักษร
if (strlen($commentdetail)<=2000)
{
if (strlen($commentname)<=50)
{
if (strlen($commentemail)<=50)
{
if ($commentemail=="" or ($commentemail<>"" and substr($commentemail,'@') and strstr($commentemail,'.') and substr($commentemail,0,1) <> '@' and substr($commentemail,0.1) <> '.' and substr($commentemail,strlen($commentemail)-1,1)<> '@' and substr($commentemail,strlen($commentemail)-1,1)<>'.'))
{
$link=mysql_connect($hostname, $username, $password);
if ($link) {
mysql_select_db($dbname);
mysql_query("SET NAMES UTF8");
$sql="select MAX(commentno) maxcomment from webboarddetail where no=$no";
include("includes/mycharset.php");
$submax1=mysql_query($sql) or die (" ไม่สามารถหาค่าสูงสุดในเทเบิลได้ ");
$submax2=mysql_fetch_array($submax1);
if (empty($submax2["maxcomment"]))
{
$currentmax=1;
} else {
$currentmax=$submax2['maxcomment']+1;
}
$currentdatetime=(date("Y")+543).date("-m-d G:i:s");
$sql ="insert into webboarddetail(no, commentno, commentdetail, commentname, commentemail, commentipaddress, commentstamp) values($no,'$currentmax', '$commentdetail', '$commentname', '$commentemail', '$REMOTE_ADDR', '$currentdatetime')";
include("includes/mycharset.php");
// print "no = $no, comment no = $currentmax";
if (mysql_query($sql))
{
print "บันทึกกระทู้ของท่านเรียบร้อยแล้ว <br>";
print "กลับไปยังกระดานข่าว --> <a href=b_openMessage.php?no=$no><B>คลิกที่นี่</B></a>";
} else{
print "เกิดความผิดพลาด !!! ไม่สามารถบันทึกข้อมูลลงในกระดานข่าวได้ ";
print "กรุณาลองอีกครั้ง --> <a href=# onclick='history.back()'><b> คลิกที่นี่ </b></a>";
}
mysql_close($link);
}
}
}
}
}
}
?>
</td>
<!-- <td width="194" valign="top">
</td> -->
</tr>
</table>
</center>
<?php
} else {
?>
<center>
<table width="580" cellspacing="0" cellpadding="0" leftmargin="0" topmargin="0" border="0">
<tr height="29">
<td colspan="3" class="boldtext">
<!-- <font color="#FF00FF">
<marquee scrollamount=2 onMouseOut=start(); onMouseOver=stop(); ><?php include("includes/tdate.php"); ?> || แค่คุณ..เปิดโอกาสให้เราสักครั้ง แล้วคุณจะรู้ว่า "เรา" ทำให้ "คุณ" คุ้มกว่าเงินที่คุณจ่ายให้เรา</fon t> -->
<td width="194" valign="top">
<!-- <?php
include("left.php");
?> -->
</td>
<td width="582" valign="top">
เรียบร้อย
</td>
<td width="194" valign="top">
<!-- <?php
include("right.php");
?> -->
</td>
</tr>
</table>
</center>
<?php
}
?>
</td>
<td background="pic/rm.jpg"> </td>
</tr>
<tr height="14">
<td background="pic/lb.jpg"></td>
<td align="center" background="pic/mb.jpg"></td>
<td background="pic/rb.jpg"></td>
</tr>
</table>
</center>
</td>
<td width="209" valign="top">
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="includes/style.css" rel="stylesheet" type="text/css">
Code (PHP)
***b_PostMessage.php
<?php
session_start();
ob_start();
if( $_SESSION["authen"] == "false" or $_SESSION["authen"] == NULL){
header("Location: login.php");
}
// $_showName=$_POST['confName'];
// $_showDetail=$_POST['confDetail'];
include("includes/a.php");
include("includes/extra.php");
// include("header.php");
$subject=$_POST['subject'];
$group_no="01";
$detail=$_POST['detail'];
$name=$_POST['name'];
$email=$_POST['email'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> +++ กระดานข่าว -- +++ </title>
</style>
<center>
<table width="980" cellspacing="0" cellpadding="0" leftmargin="0" topmargin="0" background="pic/toppage.gif" class="headertext">
<tr>
<td width="1024"><img src="pic/toppage.jpg" width="1024"></td>
</tr>
</table>
</center>
<table width="1024" cellspacing="0" cellpadding="0" leftmargin="0" topmargin="0" border="0" background="pic/mm.jpg">
<marquee scrollamount=2 onMouseOut=start(); onMouseOver=stop(); ><?php include("includes/tdate.php"); ?>
</font>
</td>
</tr>
<tr>
<td width="209" valign="top">
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="includes/style.css" rel="stylesheet" type="text/css">
<?php
include("includes/left_page.php");
?>
</td>
<td width="606" valign="top">
<table width="606" cellspacing="0" cellpadding="0" background="pic/mm.jpg">
<tr height="10" >
<td width="12" background="pic/lu.jpg"></td>
<td width="582" align="center" background="pic/mu.jpg"></td>
<td width="12" background="pic/ru.jpg"></td>
</tr>
<tr height="24">
<td background="pic/lm.jpg"> </td>
<td align="center" background="pic/mm.jpg" valign="bottom" class="boldtext">
<img src="pic/transmit.png" border="0"> +++ กระดานข่าว : Forth 577 k +++<img src="pic/transmit.png" border="0">
<hr width="95%">
<?php
if(isset($_POST["captcha"]))
if($_SESSION["captcha"]==$_POST["captcha"])
{
//CAPTHCA is valid; proceed the message: save to database, send by e-mail ...
// echo 'CAPTHCA is correct!!! your data will add to database';
?>
<center>
<table width="580" cellspacing="0" cellpadding="0" leftmargin="0" topmargin="0" border="0" class="normaltext">
<tr height="29">
<td colspan="3" class="boldtext">
</td>
</tr>
<tr>
<td width="194" valign="top">
</td>
<td width="582" valign="top">
<?php
if($subject <>"" and $detail<>"" and $name<>"")
{
//หัวข้อกระทู้ยาวไม่เกิน 150 ตัวอักษร
if (strlen($subject)<=150)
{
if (strlen($detail)<=2000)
{
if (strlen($name)<=50)
{
if (strlen($email)<=50)
{
if ($email=="" or ($email<>"" and substr($email,'@') and strstr($email,'.') and substr($email,0,1) <> '@' and substr($email,0.1) <> '.' and substr($email,strlen($email)-1,1)<> '@' and substr($email,strlen($email)-1,1)<>'.'))
{
include("includes/connectdb.php");
$link=mysql_connect($hostname, $username, $password);
if ($link) {
mysql_select_db($dbname);
mysql_query("SET NAMES UTF8");
$sql="select MAX(no) maxnumber from webboard";
include("includes/mycharset.php");
$submax1=mysql_query($sql) or die (" ไม่สามารถหาค่าสูงสุดในเทเบิลได้ ");
$submax2=mysql_fetch_array($submax1);
if (empty($submax2["maxnumber"]))
{
$currentmax=1;
} else {
$currentmax=$submax2['maxnumber']+1;
}
$currentdatetime=(date("Y")+543).date("-m-d G:i:s");
$sql ="insert into webboard(no, group_no, subject, detail, name, email, ipaddress, stamp) values($currentmax,'$group_no', '$subject', '$detail', '$name', '$email', '$REMOTE_ADDR', '$currentdatetime')";
include("includes/mycharset.php");
if (mysql_query($sql))
{
print "บันทึกกระทู้ของท่านเรียบร้อยแล้ว <br>";
print "กลับไปยังกระดานข่าว --> <a href=b_webboard.php><B>คลิกที่นี่</B></a>";
} else{
print "เกิดความผิดพลาด !!! ไม่สามารถบันทึกข้อมูลลงในกระดานข่าวได้ ";
print "กรุณาลองอีกครั้ง --> <a href=# onclick='history.back()'><b> คลิกที่นี่ </b></a>";
}
mysql_close($link);
}
}
}
}
}
}
}
?>
</td>
<td width="194" valign="top">
<!-- <?php
include("right.php");
?> -->
</td>
</tr>
</table>
</center>
<?php
}
else
{
?>
<center>
<table width="580" cellspacing="0" cellpadding="0" leftmargin="0" topmargin="0" border="0">
<tr height="29">
<td colspan="3" class="boldtext">
<!-- <font color="#FFFFFF"> -->
<!-- <marquee scrollamount=2 onMouseOut=start(); onMouseOver=stop(); ><?php include("includes/tdate.php"); ?> || แค่คุณ..เปิดโอกาสให้เราสักครั้ง แล้วคุณจะรู้ว่า "เรา" ทำให้ "คุณ" คุ้มกว่าเงินที่คุณจ่ายให้เรา</font> -->
</td>
</tr>
<tr>
<td width="194" valign="top">
<!-- <?php
include("left.php");
?> -->
</td>
<td width="582" valign="top">
เรียบร้อย
</td>
<td width="194" valign="top">
<!-- <?php
include("right.php");
?> -->
</td>
</tr>
</table>
</center>
<?php
}
?>
</td>
<td background="pic/rm.jpg"> </td>
</tr>
<tr height="14">
<td background="pic/lb.jpg"></td>
<td align="center" background="pic/mb.jpg"></td>
<td background="pic/rb.jpg"></td>
</tr>
</table>
</center>
</td>
<td width="209" valign="top">
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="includes/style.css" rel="stylesheet" type="text/css">
Code (PHP)
***b_webboard.php
<?php
session_start();
ob_start();
if( $_SESSION["authen"] == "false" or $_SESSION["authen"] == NULL){
header("Location: login.php");
}
//include("include/header.php");
include("includes/a.php");
include("includes/extra.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> +++ กระดานข่าว -- +++ </title>
</style>
<center>
<table width="980" cellspacing="0" cellpadding="0" leftmargin="0" topmargin="0" background="pic/toppage.gif" class="headertext">
<tr>
<td width="1024"><img src="pic/toppage.jpg" width="1024"></td>
</tr>
</table>
</center>
<table width="1024" cellspacing="0" cellpadding="0" leftmargin="0" topmargin="0" border="0" background="pic/mm.jpg">
<marquee scrollamount=2 onMouseOut=start(); onMouseOver=stop(); ><?php include("includes/tdate.php"); ?>
||
</font>
</td>
</tr>
<tr>
<td width="209" valign="top">
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="includes/style.css" rel="stylesheet" type="text/css">
<?php
include("includes/left_page.php");
?>
<!--mindle-->
</td>
<td width="606" valign="top">
<table width="606" cellspacing="0" cellpadding="0" background="pic/mm.jpg">
<tr height="10" >
<td width="12" background="pic/lu.jpg"></td>
<td width="582" align="center" background="pic/mu.jpg"></td>
<td width="12" background="pic/ru.jpg"></td>
</tr>
<tr height="24">
<td background="pic/lm.jpg"> </td>
<td align="center" background="pic/mm.jpg" valign="bottom" class="boldtext">
<img src="pic/transmit.png" border="0"> +++ กระดานข่าว : +++<img src="pic/transmit.png" border="0">
<hr width="95%">
<table width="580" class="boldtext">
<tr>
<td align="center" class="boldtext">
<tr>
<td colspan="3" align="center">##### <A HREF="b_frmPostMessage.php">ตั้งกระทู้ใหม่</A> #####<hr></td>
</tr>
<tr>
<td width="80%" align="center" valign="top"><B>หัวข้อกระทู้</B></td>
<td width="10%" valign="top" align="center"><B>ผู้ตอบ</B></td>
<td width="10%" valign="top" align="center"><B>เปิดอ่าน</B></td>
</tr>
<tr>
<td colspan="4" align="center"><hr></td>
</tr>
<?php
include("includes/connectdb.php");
$link=mysql_connect($hostname, $username, $password);
if ($link) {
mysql_select_db($dbname);
mysql_query("SET NAMES UTF8");
$sql="select no, subject, name, stamp, counter from webboard where group_no='01' order by no desc ";
include("includes/mycharset.php");
$table=mysql_query($sql) or die(" ไม่สามารถเรียกดูข้อมูลได้ ");
// $bg="#FFFFFF"; //#FF0000
$bg="#FF0000"; //
while ($row=mysql_fetch_array($table)) {
$r_no=$row['no'];
$r_counter=$row['counter'];
$r_stamp=$row['stamp'];
$r_subject=htmlspecialchars($row['subject']);
$r_name=htmlspecialchars($row['name']);
$r_subject=ereg_replace(" ", " ", $r_subject);
$r_showno=substr('0000'.$r_no,strlen('0000'.$r_no)-5,5);
$sql="select count(no) countnumber from webboarddetail where no=$r_no";
include("includes/mycharset.php");
$subcount1=mysql_query($sql) or dir (" ไม่สามารถนับจำนวนความคิดเห็นได้ ");
$subcount2=mysql_fetch_array($subcount1);
if (empty($subcount2["countnumber"]))
{
$currentcount=0;
} else {
$currentcount=$subcount2["countnumber"];
}
if ($bg=="#FFFFFF") {
$bg="";
} else {
$bg="#FFFFFF";
}
print "<tr>";
print "<td bgcolor=$bg><img src=pic/pencil.png> $r_showno - <a href=b_openMessage.php?no=$r_no target=_blank>$r_subject </a> [$r_name] </td>";
print "<td bgcolor=$bg><center>$currentcount </center></td>";
print "<td bgcolor=$bg><center>$r_counter</center></td>";
print "</tr>";
}
}
?>
<tr>
<td colspan="3" align="center"><hr></td>
</tr>
<tr>
<td colspan="3" align="center">##### <A HREF="b_frmPostMessage.php">ตั้งกระทู้ใหม่</A> #####</td>
</tr>
</table>
<!-- ใส่เนื้อหาที่นี่ -->
<table width="580" class="boldtext">
<tr>
<td align="center" class="boldtext">
<!-- <IMG SRC="pic/picture3.jpg" WIDTH="167" HEIGHT="200" BORDER="0" ALT="">
<IMG SRC="pic/picture1.jpg" WIDTH="167" HEIGHT="200" BORDER="0" ALT=""> -->
</td>
</tr>
</table>
</td>
<td background="pic/rm.jpg"> </td>
</tr>
<tr height="14">
<td background="pic/lb.jpg"></td>
<td align="center" background="pic/mb.jpg"></td>
<td background="pic/rb.jpg"></td>
</tr>
</table>
</center>
</td>
<td width="209" valign="top">
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="includes/style.css" rel="stylesheet" type="text/css">
ช่วยดูโค้ดให้หน่อยค่ะ
เวปบอร์ดค่ะ เวลาใส่ อีเมล์เข้าไป มันจะไม่สามารถโพสได้ ถ้าเราไม่ใส่อีเมล์จะตั้งกระทู้ หรือ ตอบได้ค่ะ มันไม่แสดงไอพีของผู้ตอบหรือตั้งกระทู้ด้วยค่ะ
อีเมล์มันก็ไม่แสดงข้อมูล รบกวนพี่ช่วนดูหน่อยค่ะ
จะใช้ร่วมกับฐานข้อมูลค่ะ
|
|
|
|
|
Date :
2011-01-10 16:08:34 |
By :
wongkhajang |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณค่ะ
|
|
|
|
|
Date :
2011-02-02 15:35:17 |
By :
pinpanter |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|