/home/nondinda/domains/nondindaengcity.go.th/public_html/php_webboard_v1/ViewWebboard.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?
/*
 * Script Name: PHP Webboard
 * Version : 1.0
 * License : Free
 * Date : 24/02/2018
 * Web URI: http://phpscrip.com
 * Begin SourceCode : Thaicreate.com
 * Modify By : newaiman
 * Last Modify : 24/02/2018
 */
$objConnect mysql_connect("localhost","db_user","db_password") or die("Error Connect to Database");
$objDB mysql_select_db("db_name");

if(
$_GET["Action"] == "Save")
{
    
//*** Insert Reply ***//
    
$strSQL "INSERT INTO reply ";
    
$strSQL .="(QuestionID,CreateDate,Details,Name) ";
    
$strSQL .="VALUES ";
    
$strSQL .="('".$_GET["QuestionID"]."','".date("Y-m-d H:i:s")."','".$_POST["txtDetails"]."','".$_POST["txtName"]."') ";
    
$objQuery mysql_query($strSQL);
    
    
//*** Update Reply ***//
    
$strSQL "UPDATE webboard ";
    
$strSQL .="SET Reply = Reply + 1 WHERE QuestionID = '".$_GET["QuestionID"]."' ";
    
$objQuery mysql_query($strSQL);    
}
?>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ViewWebboard : PhpScrip.Com</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="แจกสคริป Webboard Php ใช้งานง่าย ไม่ยุ่งยาก" />
<meta name="keywords" content="สคริปเว็บบอร์ด php, php webboard, free php board" />
<meta name="googlebot" content="index,follow"/>
<meta http-equiv="Content-Language" CONTENT="TH-TH">
<style type="text/css">
<!--
a:link {
    text-decoration: none;
}
a:visited {
    text-decoration: none;
}
a:hover {
    text-decoration: none;
}
a:active {
    text-decoration: none;
}
-->
</style></head>
<body>
<p><br>
<a href="index.php">กลับไปยังหน้าบอร์ด</a></p>
<p>
  <?
//*** Select Question ***//
$strSQL "SELECT * FROM webboard  WHERE QuestionID = '".$_GET["QuestionID"]."' ";
$objQuery mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$objResult mysql_fetch_array($objQuery);

//*** Update View ***//
$strSQL "UPDATE webboard ";
$strSQL .="SET View = View + 1 WHERE QuestionID = '".$_GET["QuestionID"]."' ";
$objQuery mysql_query($strSQL);    
?>
</p>
<table width="738" border="1" cellpadding="1" cellspacing="1">
  <tr>
    <td height="31" colspan="2" bgcolor="#E6FFE6"><center><h1><?=$objResult["Question"];?></h1>
    </center></td>
  </tr>
  <tr>
    <td height="82" colspan="2"><?=nl2br($objResult["Details"]);?></td>
  </tr>
  <tr>
    <td width="397" bgcolor="#EAFFFF">ชื่อ : <?=$objResult["Name"];?>
     วันที่โพสท์  :      <?=$objResult["CreateDate"];?></td>
    <td width="253" bgcolor="#FFFFD5">ดู : 
    <?=$objResult["View"];?> ตอบกลับ : <?=$objResult["Reply"];?></td>
  </tr>
</table>
<br>
<br>
<?
$intRows 
0;
$strSQL2 "SELECT * FROM reply  WHERE QuestionID = '".$_GET["QuestionID"]."' ";
$objQuery2 mysql_query($strSQL2) or die ("Error Query [".$strSQL."]");
while(
$objResult2 mysql_fetch_array($objQuery2))
{
    
$intRows++;
?> ลำดับ : <?=$intRows;?>
<table width="738" border="1" cellpadding="1" cellspacing="1">
  <tr>
    <td height="53"><?=nl2br($objResult2["Details"]);?></td>
  </tr>
  <tr>
    <td width="397" bgcolor="#EAFFFF">ชื่อ :
        <?=$objResult2["Name"];?>
        วันที่ตอบ :
      <?=$objResult2["CreateDate"];?></td>
  </tr>
</table>
<br>
<?
}
?>
<br>
<br>
<br>
<form action="ViewWebboard.php?QuestionID=<?=$_GET["QuestionID"];?>&Action=Save" method="post" name="frmMain" id="frmMain">
  <strong>ตอบกลับกระทู้นี้</strong><br>
  <table width="738" border="1" cellpadding="1" cellspacing="1">
    <tr>
      <td width="78" bgcolor="#FFFFD5"><div align="center">รายละเอียด</div></td>
      <td><textarea name="txtDetails" cols="80" rows="5" id="txtDetails"></textarea></td>
    </tr>
    <tr>
      <td width="78" bgcolor="#EAFFFF"><div align="center">ชื่อ</div></td>
      <td width="647"><input name="txtName" type="text" id="txtName" value="" size="80"></td>
    </tr>
  </table>
  
  <p>
    <input name="btnSave" type="submit" id="btnSave" value="ตอบกลับ">
  </p>
</form>
</body>
</html>
<?
mysql_close
($objConnect);
?>