|
![](/images/resource/spacer.gif) |
|
ช่วยดูโค้ตให้ผมทีคับพอดีผมทำเพิ่มข้อมูลลงฐานข้อมูลบ้างอย่างมันไม่ลงคับ |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
พี่ๆช่วยดูโค้ตให้ผมทีคับ พอดีผมทำเพิ่มข่าว จะมีหัวข้อ วันที่ รายละเอียด ทีนี้พอกดเพิ่มแล้ว หัวข้อกับวันที่ลง sql แต่ รายละเอียดไม่ลงคับ
ช่วยดูและแก้ให้ทีคับ
โค้ต หน้า เพิ่มข่าวคับ
<!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=windows-874" />
<title>เพิ่มข่าวสาร</title>
<script language="JavaScript" src="calendar.js" type="text/javascript"></script>
<link href="calendar-mos.css" rel="stylesheet" type="text/css" />
</head>
<?
if ($_REQUEST[send]!=""){
include('config.inc.php');
# Block HTML TAG
$topic=$_REQUEST["topic"];
$detail=$_REQUEST["detail"];
$type=$_REQUEST["n_type"];
$date=$_REQUEST["date"];
$d = substr($date,0,2) ;
$m = substr($date,3,2);
$y= substr($date,6);
$date = $y."-".$m."-".$d;
# Block Special TAG
$topic=addslashes($topic);
$detail=wordwrap($detail,100,"\n",1);
$connect=mysql_connect($host,$rootadmin,$rootpassword) or die("Could not connect: " . mysql_error());
$select=mysql_select_db($dbname);
//echo $n_file_type."<br>";
$query="INSERT INTO news (topic, detail, date) VALUES('$topic','$detail','$date')";
//echo $query."<br>";
$result=mysql_query($query);
//mysql_close($connect);
?>
<script language="JavaScript">
window.opener.location.reload();
window.close();
</script>
<?
}
?>
<body>
<table width='700' border="0" cellpadding="0" cellspacing="0" >
<tr >
<td background="images/images/bansiao_21.png" height="29">
<div class='menu_bar'>
<?
$now = date("d")."/".date("m")."/".date("Y");
if ($_REQUEST[page_f] == '11'){
$n_type = 'information';
echo " <b>เพิ่มข่าวประชาสัมพันธ์</b>";
}elseif($_REQUEST[page_f] == '15'){
$n_type = 'contest';
echo " <b>เพิ่มข่าวประกวดราคา</b>";
}
?>
</div>
</td>
</tr>
<tr>
<td valign='top' align='center'>
<form name='addnews' action='#' method='post' enctype="multipart/form-data" onsubmit="return check()">
<table width='100%' cellpadding=2 cellspacing=1 border=0 >
<tr>
<td width='100'><div>
<div align="right">หัวข้อข่าว :
</div>
</div>
</td>
<td width='370'><div><input type='text' name='topic' value='<? echo $topic;?>' size='60' maxlength='255'></div>
</td>
</tr>
<tr>
<td height="30" align="left"><div align="right">วันที่ประกาศ :
</div></td>
<td>
<div><? if ($_REQUEST[date]=='') $date=$now; ?>
<input type="text" value="<?php echo $date; ?>" size="10"name="date">
<img src='images/calendar_16.png' onClick="showCalendar('date','DD/MM/YYYY')"></div> </td>
</tr>
<tr>
<td width='100' valign='top'><div>
<div align="right">รายละเอียด :
</div>
</div>
</td>
<td width='370'>
<script type="text/javascript" src="CKeditor/ckeditor.js"></script>
<div><textarea name='pro_detail' rows='10' cols='50' class="ckeditor" ><? echo $detail;?></textarea></div>
</td>
</tr>
<tr>
<td width='100' colspan='2' align='center'><div>
<input type='hidden' name='n_type' value='<? echo $n_type;?>'>
<input type='submit' name='send' value='เพิ่มข่าว'>
</div>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
หน้าโชว์ข่าวคับ
<td><? if ($_SESSION["user"]!=""){?>
<a href='showdata.php'>ลบข่าว</a>
<font color="blue" size="2"><a href="#" class="contact" onclick="javascript:popup('add_news.php','',650,500)" >เพิ่มข่าว</a></font> <? }?>
<marquee direction="up" height="100" onmouseout="this.start()" onmouseover="this.stop()" scrollamount="1" scrolldelay="30" width="100%" truespeed><font size="3">
<br>
</font>
<? $sql1="select * from news order by date limit 5";
$query1=mysql_query($sql1);
while ($arr1 =mysql_fetch_array($query1)){
echo $arr1[date]. $arr1[topic].$arr1[detail]."<br>";
}
?></td>
Tag : PHP, MySQL
![](/images/adv.jpg?v=1001)
|
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2012-12-19 18:53:28 |
By :
jamjung002 |
View :
900 |
Reply :
1 |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
<script type="text/javascript" src="CKeditor/ckeditor.js"></script>
094.
<div><textarea name='pro_detail' rows='10' cols='50' class="ckeditor" ><? echo $detail;?></textarea></div>
กับ
$topic=$_REQUEST["topic"];
015.
$detail=$_REQUEST["detail"];
016.
$type=$_REQUEST["n_type"];
'ลองแก้..
$detail=$_REQUEST["detail"];
เป็น
$detail=$_REQUEST["pro_detail"];
ดูครับ
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2012-12-19 21:59:31 |
By :
pudthaiiii |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 04
|