<!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>jQuery Ajax Comment System - Demo</title> <link rel="stylesheet" href="css/style.css"> <script src="js/jquery.min.js"></script> <script src="js/script.js"></script> <link href="general.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/jquery-ui.min.js"></script> <script type="text/javascript" src="js/jquery.ui.touch-punch.min.js"></script> <script type="text/javascript" src="facescroll.js"> /*********************************************** * FaceScroll custom scrollbar (c) Dynamic Drive (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit http://www.dynamicdrive.com/ for this script and 100s more. ***********************************************/ </script> <script type="text/javascript"> jQuery(function(){ // on page DOM load $('#demo1').alternateScroll(); $('#demo2').alternateScroll({ 'vertical-bar-class': 'styled-v-bar', 'hide-bars': false }); }) </script> </head> <body> <div class="wrap"> <h1>jQuery Ajax Comment System</h1> <?php $host="localhost"; $user_name="root"; $pass_word="1234"; $db="demo"; mysql_query("SET NAMES utf-8"); mysql_connect( $host,$user_name,$pass_word) or die ("ติดต่อกับฐานข้อมูล Mysql ไม่ได้ "); mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้"); mysql_query("SET NAMES TIS620"); mysql_query("SET character_set_results=UTF8"); mysql_query("SET character_set_client=UTF8"); mysql_query("SET character_set_connection=UTF8"); // retrive post //require ('config.php'); require ('function.php'); //dbConnect(); //$query = mysql_query('SELECT * FROM post WHERE post_id = 1'); //$row = mysql_fetch_array($query); //$result = mysql_query('SELECT * FROM post'); //$num = mysql_num_rows($result); //echo $num; //exit; $row=mysql_fetch_array(mysql_query('SELECT * FROM post WHERE post_id = 4')); /* require("connect/connect.php"); //include("/nv/connect/connect.php") $result = mysql_query('SELECT * FROM atm'); $num = mysql_num_rows($result); //echo $num; //exit; $_POST['locat_name']= 3; if($_POST['locat_name']!=''){ $d=$_POST['locat_name']; $showMaps=mysql_fetch_array(mysql_query('SELECT * FROM cat WHERE ID='.$d)); */ ?> <div class="post"> <h2><?php echo $row['post_title']?></h2> <p><?php echo $row['post_body']?></p> </div> <?php // retrive comments with post id $comment_query = mysql_query( "SELECT * FROM comment WHERE post_id = {$row['post_id']} ORDER BY id DESC LIMIT 15"); //$comment_query = mysql_query( /*"SELECT * FROM comment WHERE post_id = {$row['post_id']} ORDER BY id DESC Limit 15")or die(mysql_error());*/ ?> <h2>Comments.....</h2> <div class="comment-block"> <?php while($comment = mysql_fetch_array($comment_query)): ?> <div class="comment-item"> <div class="comment-avatar"> <img src="<?php echo avatar($comment['mail']) ?>" alt="avatar"> </div> <div class="comment-post"> <h3><?php echo $comment['name'] ?> <span>โพสต์เมื่อ <? echo dateTimeDiff ($comment[datetime])?></span></h3> <p><?php echo $comment['comment']?></p> </div> </div> <?php endwhile?> </div> <h2>Submit new comment</h2> <!--comment form --> <form id="form" method="post"> <!-- need to supply post id with hidden fild --> <input type="hidden" name="postid" value="<?php echo $row['post_id']?>"> <label> <span>Name *</span> <input type="text" name="name" id="comment-name" placeholder="Your name here...." required> </label> <label> <span>Email *</span> <input type="email" name="mail" id="comment-mail" placeholder="Your mail here...." required> </label> <label> <span>Your comment *</span> <textarea name="comment" id="comment" cols="30" rows="10" placeholder="Type your comment here...." required></textarea> </label> <input type="submit" id="submit" value="Submit Comment"> </form> </div> </body> </html>
<div style="width:120px;height: 285px; overflow-y: scroll; scrollbar-arrow-color:blue; scrollbar-face-color: #e7e7e7; scrollbar-3dlight-color: #a0a0a0; scrollbar-darkshadow-color:#888888"> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> Test<Br> </div>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง