 |
|
หน้า guestbook มันขึ้นว่า
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\hkshop\guestbook.php on line 224
โค้ดหน้าคำสั่งหน้า guestbook
<?
$sql="
select p1.* , date(postdate) as sdate,
time(postdate) as stime,
from guestbook as p1,
order by id desc";
$result=mysql_query($sql,$link);
//ใช้นับจำนานหน้าทั้งหมด
$pagesize=20;
$totalpage=ceil($total/$pagesize);
if($page=="")
{
$page=1;
}
$start=($page-1)*$pagesize;
$sql.=" limit $start,$pagesize";
$result=mysql_query($sql,$link);
while($arr=mysql_fetch_array($result)) อันนี้คือ line 224 ค่ะ
{
?>
หน้า addguestbook มันขึ้นว่า
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\hkshop\db.php:8) in C:\AppServ\www\hkshop\addguestbook.php on line 21
โค้ดหน้าคำสั่งหน้า addguestbook
<?
header('Content-type: text/html; charset=utf-8'); // SET Header Encoding
session_start();
include("function_inc.php");
include("db.php");
include("config.php");
if(!isset($_POST['Submit']))
{
header("location:index.php");
}
else
{
$name=trim($_POST['name']);
$message=trim($_POST['message']);
include("securimage/securimage.php");
$img = new Securimage();
$valid = $img->check($_POST['code']);
if( $message=="")
{
$msg=msg("โปรดระบุข้อความด้วยค่ะ",1); อันนี้คือ line 21 ค่ะ
header("refresh:2;url=guestbook.php?id=$id");
}
elseif($valid == false)
{
$msg=msg("Code ไม่ถูกต้อง กรุณากรอกให้ถูกต้องด้วยค่ะ",1);
header("refresh:2;url=guestbook.php?id=$id");
}
else
{
$sql="insert into guestbook(name, message)values ('".$_COOKIE['loginname']."','$message')";
if (!mysql_query($sql, $link))
{
$msg=msg("ไม่สามรถเพิ่มข้อมูลได้ กรุณาลองใหม่อีกครั้ง",1);
header("refresh:2;url=guestbook.php?id=$id");
}
else
{
$msg=msg("ได้รับข้อมูลแล้ว ขอบคุณที่เยี่ยมชมเว็บของเรา<br><br>โปรดรอสักครู่....",2);
header("refresh:2;url=guestbook.php?id=$id");
}
}
}
?>
Tag : PHP, CakePHP
|
|
 |
 |
 |
 |
Date :
2010-10-07 14:59:01 |
By :
วรพินทร์ |
View :
2735 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |