|
|
|
รบกวนหน่อยนะครับ มีปัญหาเรื่องการแสดงผล ครับ ไม่รู้ว่าต้องแก้ไขยังไงครับช่วยหน่อยครับ |
|
|
|
|
|
|
|
โค้ดล่ะครับ
|
|
|
|
|
Date :
2013-04-06 14:01:21 |
By :
dagonov |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
โค้ดตอนดึงมาแสดงผล
<?php
echo $arrcom['detail'];
?>
|
|
|
|
|
Date :
2013-04-06 14:06:04 |
By :
JindaCpe8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
โค๊ดหน้าแสดงผล ทั้งหน้าสิครับ
|
|
|
|
|
Date :
2013-04-06 14:11:44 |
By :
Ex-[S]i[L]e[N]t |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
นี่เลยครับ
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<link href="css/styles.css" rel="stylesheet" type="text/css">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="box3">
<?
$idtopic=$_GET['idtopic'];
$sql="select * from topic where t_id=$idtopic";
$query=mysql_query($sql);
$arr=mysql_fetch_array($query);
$sqluser="select * from user where id_mem=$id_mem";
$queryuser=mysql_query($sqluser);
$arruser=mysql_fetch_array($queryuser);
?>
<title><?=$arr['title'];?></title>
<tr>
<td ><h1><font color="#FFCC00"><?=$arr['title'];?></font></h1></td>
</tr>
<tr>
<td><h3><p><?=$arr['detail'];?></p></h3></td>
</tr>
<tr>
<td>
<font color="#FFCC66"><b><?
if($arr['id_mem']==$arruser['id_mem']){
echo $arruser['username'];
}?></b></font> - <?=dateTimeDiff($arr['date']);?></td>
</tr>
</table>
<br>
<?
$sqlcom="select * from comment where t_id=$idtopic order by c_id desc";
$querycom=mysql_query($sqlcom);
while($arrcom=mysql_fetch_array($querycom)){
?>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="box">
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="2"><p>
<?
echo $arrcom['detail'];
?></p></td>
</tr>
<tr>
<td width="90%">
<font color="#FFCC00"><b><? if($arrcom['id_mem']==$arruser['id_mem']){
echo $arruser['username'];
}
?></b></font> - <?=dateTimeDiff($arrcom['date']);?></td>
<td align="right" valign="bottom"><table width="100%" border="0" align="right" cellpadding="1" cellspacing="0">
<tr>
<td width="37%" align="right" valign="bottom"><img src="img/toggle-small-expand.png" width="16" height="16" border="0"></td>
<td width="63%" align="left" valign="top"><a href="#">ตอบกลับ</a></td>
</tr>
</table></td>
</tr>
</table>
<br>
<?
}
?>
<? if($_SESSION){ ?>
<form action="index.php?home=insercomment" method="post" name="form1">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="box">
<tr>
<td colspan="3">
<div>
<textarea name="detail" cols="150" rows="15" class="tetfilddetail" id="detail" ></textarea>
<div id="toolbar">
</div>
</div>
</td>
</tr>
<tr>
<td width="12%"><input type="submit" class="classname" name="Submit" value="แสดงความคิดเห็น"></td>
<td width="3%"><img src="MyResize/<?=$arruser['File']; ?>" width="31" height="31" border="0" class="pic" /></td>
<td width="85%"><strong>สมาชิกหมายเลข :</strong>
<?=$arruser['id_mem']; ?> | <?=$arruser['username']; ?>
<input name="id_mem" type="hidden" id="id_mem" value="<?=$arruser['id_mem']; ?>">
<input name="t_id" type="hidden" id="t_id" value="<?=$idtopic;?>"></td>
</tr>
</table>
</form>
<?
}
?>
หน้าตอนแอดลงฐานข้อมูล
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<?
$detail=$_POST['detail'];
$date=date("Y-m-d H:i:s");
$id_mem=$_POST['id_mem'];
$t_id=$_POST['t_id'];
$sqlpost= "insert into comment values('','$detail','$date','$id_mem','$t_id')";
if(mysql_query($sqlpost)){
echo "<script>alert('แสดงความคิดเห็นเสร็จสิ้นสมบูรณ์');window.location='index.php?home=detail_from&idtopic=$t_id';</script>";
}else{
echo "<script>alert('ไม่สามารถแสดงความคิดเห็นได้!!!');history.back();</script>";
}
?>
|
|
|
|
|
Date :
2013-04-06 14:34:32 |
By :
JindaCpe8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองดูแบบนี้ครั
Code (PHP)
<?
$idtopic=$_GET['idtopic'];
$sql="select * from topic where t_id='".$idTopic."'";
$query=mysql_query($sql);
$arr=mysql_fetch_array($query);
$sqluser="select * from user where id_mem=$id_mem";
$queryuser=mysql_query($sqluser);
$arruser=mysql_fetch_array($queryuser);
?>
<title><?=$arr['title'];?></title>
<tr>
<td ><h1><font color="#FFCC00"><?=$arr['title'];?></font></h1></td>
</tr>
<tr>
<td><h3><p><?=$arr['detail'];?></p></h3></td>
</tr>
<tr>
<td>
<font color="#FFCC66"><b><?
if($arr['id_mem']==$arruser['id_mem']){
echo $arruser['username'];
}?></b></font> - <?=dateTimeDiff($arr['date']);?></td>
</tr>
</table>
<br>
<?
$sqlcom="select * from comment where t_id='".$idTopic."' order by c_id desc";
$querycom=mysql_query($sqlcom);
while($arrcom=mysql_fetch_array($querycom)){
?>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="box">
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="2"><p>
<?
echo $arrcom['detail'];
?></p></td>
</tr>
<tr>
<td width="90%">
<font color="#FFCC00"><b><? if($arrcom['id_mem']==$arruser['id_mem']){
echo $arruser['username'];
}
?></b></font> - <?=dateTimeDiff($arrcom['date']);?></td>
<td align="right" valign="bottom"><table width="100%" border="0" align="right" cellpadding="1" cellspacing="0">
<tr>
<td width="37%" align="right" valign="bottom"><img src="img/toggle-small-expand.png" width="16" height="16" border="0"></td>
<td width="63%" align="left" valign="top"><a href="#">ตอบกลับ</a></td>
</tr>
</table></td>
</tr>
</table>
<br>
<?
}
?>
|
|
|
|
|
Date :
2013-04-06 14:51:15 |
By :
Ex-[S]i[L]e[N]t |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไม่ได้ครับ เหมือนเดิม
|
|
|
|
|
Date :
2013-04-06 14:57:50 |
By :
JindaCpe8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลืมอ่านโทษที เป็น code BBCode
|
ประวัติการแก้ไข 2013-04-06 15:40:18
|
|
|
|
Date :
2013-04-06 15:30:16 |
By :
teez1232002 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
https://www.thaicreate.com/php/forum/071001.html
คงจะเป้นอันนี้
|
|
|
|
|
Date :
2013-04-06 15:48:38 |
By :
teez1232002 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตอนนี้เปลี่ยนใช้ ckeditor แสดงผลถูกต้องแล้วครับ
|
|
|
|
|
Date :
2013-04-06 15:57:57 |
By :
JindaCpe8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|