|
|
|
ช่วยดูโค๊ดให้หน่อยครับบ...ผมรันไฟล์ deletebook.php ..require_once("../include/connect_db.php"); |
|
|
|
|
|
|
|
ผมรันไฟล์ deletebook.php
รูปภาพ
ไฟล์ deletebook.php
<?
require_once("../include/connect_db.php");
require_once("../include/function.php");
require_once("../chapter19/headeradmin.php");
require_once("../include/check_data.php");
session_start();
header_admin("ลบรายการหนังสือ");
if(!filled_out($HTTP_POST_VARS))
{
echo "เกิดความผิดพลาดในการป้อนรายละเอียด กรุณาตรวจสอบอีกครั้ง";
header_html("การป้อนข้อมูลเกิดความผิดพลาด");
require_once("../include/footer.php");
exit;
}
if (check_admin())
{
if(delete_book($isbn))
echo "<center>ลบหนังสือ ISBN '$isbn' ในฐานข้อมูลเรียบร้อย</center>";
else
echo " <center>หนังสือชื่อ '$isbn' ไม่สามารถลบในฐานข้อมูลได้</center>";
}
else
echo "คุณไม่มีสิทธิลบข้อมูล";
require_once("../include/footer.php");
?>
ไฟล์ function.php
<?
//================================================================================
function login($username,$password,$databasename,$tablename)
/*??????? username ??? password ????????????
?????????????????????? ?????????????????????????
*/
{
//??????????????????
$conn = connect_db($bookonline);
if(!$conn)
return 0;
//??????? username ???????????????????????????
$sql = "select * from $tablename where username='$username' and password=password('$password')";
$result = mysql_query($sql);
if(!$result)
return 0;
if(mysql_num_rows($result)>0)
return 1;
else
return 0;
}
//================================================================================
function select_cat($key)
{
$conn=connect_db("bookonline");
if(!$conn)
echo "?????????????????????????????????????????????";
$sql="select * from categories where catid='$key' ";
$result = mysql_query($sql);
if(!$result)
return 0;
else
return $result;
}
function select_book($isbn)
{
$conn=connect_db("bookonline");
if(!$conn)
echo "?????????????????????????????????????????????";
$sql="select * from books where isbn='$isbn' ";
$result = mysql_query($sql);
if(!$result)
return 0;
else
return $result;
}
//=================================================================================
/*??????????????????????????*/
function insert_book($isbn,$author,$title,$price,$description,$picture,$publisher,$time,$page,$catid)
{
$con=connect_db("bookonline");
if(!$con)
{
return "?????????????????????????????? ???????????????????";
exit;
}
$sql = "select * from books where isbn='$isbn'";
$result = mysql_query($sql);
if(!$result)
return "?????????????? ???????? <br>";
if(mysql_num_rows($result)>0)
return "?????????????????????????????? <br>";
$result = mysql_query("insert into books values ('$isbn','$author','$title',$price,'$description','$picture','$publisher','$time','$page',$catid)");
if(!$result)
return("??????????????????????????????");
else
return true;
}
//=================================================================================
/*???????????????????????*/
function delete_book($isbn)
{
$con=connect_db("bookonline");
if(!$con)
return "?????????????????????????????? ???????????????????";
$result = mysql_query("delete from books where isbn='$isbn'");
if(!$result)
return("???????????????????????????");
else
return true;
}
//=================================================================================
/*?????????????????????????????????*/
function edit_book($oldisbn,$isbn,$author,$title,$price,$description,$picture,$publisher,$time,$page,$catid)
{
$con=connect_db("bookonline");
if(!$con)
return "?????????????????????????????? ???????????????????";
$sql="update books set isbn='$isbn' ,author='$author',title='$title' ,price=$price , description = '$description' , picture='$picture' , publisher='$publisher' ,time='$time' , page=$page , catid = $catid where isbn='$oldisbn' ";
$result = mysql_query($sql);
if(!$result)
return("??????????????????????????????");
else
return true;
}
//=================================================================================
function insert_cat($catname)
{
$con=connect_db("bookonline");
if(!$con)
{
return "?????????????????????????????? ???????????????????";
exit;
}
$result = mysql_query("insert into categories(catname) values ('$catname')");
if(!$result)
return("???????????????????????????????");
else
return true;
}
//=================================================================================
//????????????????????
function edit_cat($catid,$catname)
{
$con=connect_db("bookonline");
if(!$con)
return "?????????????????????????????? ???????????????????";
$sql="update categories set catname='$catname' where catid = $catid ";
$result = mysql_query($sql);
if(!$result)
return("??????????????????????????????");
else
return true;
}
//=================================================================================
function delete_cat($catid)
{
$con=connect_db("bookonline");
if(!$con)
return "?????????????????????????????? ???????????????????";
$result = mysql_query("delete from categories where catid='$catid'");
if(!$result)
return("????????????????????????????");
else
return true;
}
//=================================================================================
/*????????????????????????????????????????????????*/
function db_to_array($result)
{
$result_array=array();
for($count=0;$row=@mysql_fetch_array($result);$count++)
$result_array[$count]=$row;
return $result_array;
}
//=================================================================================
/*????????????????????????????*/
function calculate_price($cart)
{
$price = 0.0;
if(is_array($cart))
{
$conn = connect_db("bookonline");
foreach($cart as $isbn => $qty)
{
$query = "select price from books where isbn='$isbn'";
$result = mysql_query($query);
if ($result)
{
$item_price = mysql_result($result, 0, "price");
$price +=$item_price*$qty;
}
}
}
return $price;
}
//=================================================================================
/*???????????????????????????*/
function calculate_items($cart)
{
// ??????????????????????
$items = 0;
if(is_array($cart))
{
foreach($cart as $isbn => $qty)
{
$items += $qty;
}
}
return $items;
}
//=================================================================================
//????????????????????????????
function display_cart($cart,$change)
{
global $items;
global $total_price;
echo "<table border = 0 width = 100% cellspacing = 0 align=center>
<form action = ../chapter20/show_cart.php method = post>
<tr bgcolor=FFBBBB>
<th><font face=MS Sans Serif size=3>???????????</font></th>
<th><font face=MS Sans Serif size=3>???????????</font></th>
<th><font face=MS Sans Serif size=3>????</font></th>
<th><font face=MS Sans Serif size=3>?????</font></th>
<th><font face=MS Sans Serif size=3>???????</font></th>
</tr>";
foreach ($cart as $isbn => $qty)
{
$book = get_book_details($isbn);
echo "<tr>";
echo "<td>";
echo "<a href = \"../chapter20/detailbook.php?isbn=".$isbn."\"><font face=\"MS Sans Serif\" size=2>".$book["title"]."</font></a></td>" ;
echo "<td><font face=\"MS Sans serif\" size=2>".$book["author"]."</font></td>";
echo "<td align = center><font face=\"MS Sans Serif\" size=2>".number_format($book["price"], 2) ."</font></td>";
echo "<td align = center>";
if ($change == true)
echo "<input type = text name = \"$isbn\" value = $qty size = 2>";
else
echo "<font face=\"MS Sans serif\" size=2>".$qty."</font>";
echo "</td><td align = right><font face=\"MS Sans Serif\" size=2>" .number_format($book["price"]*$qty,2). " ???</font></td></tr>\n";
}
// ????????????????
echo "<tr bgcolor=#FFAAAA>
<th align = left colspan=3>??????????????????????</th>
<th align = center>$items</th>
<th align = right>".number_format($total_price, 2)." ???</th></tr>";
if($change == true)
{
echo "<tr>
<td colspan =4> </td>
<td align = center>
<input type = hidden name = new value =0 >
<input type = hidden name = save value = true>
<input type = submit value = \"????????????????????\">
</td>
<td> </td>
</tr>";
}
echo "</form></table>";
}
//=================================================================================
function checkout_form()
{
//????????????????????????????????????
?>
<br>
<table border = "0" width = "100%" cellspacing = "0" bgcolor="#FFEEEE" align="center">
<form action = "../chapter20/purchase.php" method = "post">
<tr><th colspan = "2" bgcolor="#FFBBBB">???????????????????</th></tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">????</font></th>
<td><input type = "text" name = "name" value = "" maxlength = "40" size = "30"></td>
</tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">???????</font></th>
<td><input type = "text" name = "surname" value = "" maxlength = "20" size = "30"></td>
</tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">????????????? </font></th>
<td><input type = "text" name = "phone" value = "" maxlength = "20" size = 20></td>
</tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">??????? </font></th>
<td><input type = "text" name = "address" value = "" maxlength = "100" size = "40"></td>
</tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">?????/???</font></th>
<td><input type = "text" name = "district" value = "" maxlength = "20" size = "20"></td>
</tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">???????</font></th>
<td><input type = "text" name = "province" value = "" maxlength = "20" size = "20"></td>
</tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">????????????</font></th>
<td><input type = "text" name = "zip" value = "" maxlength = "10" size = "10"></td>
</tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">??????</font></th>
<td><input type = text name = "country" value = "" maxlength = "20" size = "20"></td>
</tr>
<tr><th colspan = "2" bgcolor="#FFBBBB">????????????????????????? (??????????????????????????????????????)</th></tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">????</font></th>
<td><input type = text name = "ship_name" value = "" maxlength = 20 size = 30></td>
</tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">???????</font></th>
<td><input type = text name = "ship_surname" value = "" maxlength = 20 size = 30></td>
</tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">?????????????</font></th>
<td><input type = text name = "ship_phone" value = "" maxlength = 20 size = 20></td>
</tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">???????</font></th>
<td><input type = text name = "ship_address" value = "" maxlength = 100 size = 40></td>
</tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">?????/???</font></th>
<td><input type = text name = "ship_district" value = "" maxlength = 20 size = 20></td>
</tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">???????</font></th>
<td><input type = text name = "ship_province" value = "" maxlength = "20" size = "20"></td>
</tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">????????????</font></th>
<td><input type = "text" name = "ship_zip" value = "" maxlength = "10" size = "10"></td>
</tr>
<tr>
<th align="left"><font face="Ms sans serif" size="3" style="margin: 2cm">??????</font></th>
<td><input type = "text" name = "ship_country" value = "" maxlength = "20" size = "20"></td>
</tr>
<tr>
<td colspan = "2" align = "center">
<font face="Ms Sans serif" size="2"><b>??????????????????????????????????????????? ?????????????? ??????????????? ??????????????? ?????????????? ?????????????????????????????????????</b></font>
</td>
</tr>
<tr>
<td align="center"><input type="submit" value="??????????????"></td>
</form>
<td align="center"><form action="../chapter19/home.php" method="post"><input type="submit" value="??????????????"></form></td>
</tr>
</table>
<?
}
//=================================================================================
function display_shipping($shipping)
{
// ???????????????????
global $total_price;
global $items;
?>
<table border = 0 width = "100%" cellspacing = "0" align="center">
<tr><td align = left><font face="MS Sans Serif" size=3>?????????</font></td>
<td align = right><font face="MS Sans Serif" size=3><?=number_format($shipping, 2); ?> ???</font></td></tr>
<tr bgcolor="#FF7777"><th align = "left"><font face=MS Sans Serif size=3>??????????????</font></th>
<th align = "right"><font face=MS Sans Serif size=3><?=number_format($shipping+$total_price, 2); ?> ???</font></th>
</tr>
</table><br>
<?
}
//=============================================================================
function card_form($name)
{
//???????????????????????????????????????
extract($name);
?>
<table border = 0 width = 100% cellspacing = 0 bgcolor="#FFEEEE" align="center">
<form action = "../chapter20/process.php" method = post>
<tr><th colspan = 2 bgcolor="#FFBBBB">????????????????????????????????</th></tr>
<tr>
<td><font face="MS Sans Serif" size=3 style="margin: 1cm">????</font></td>
<td><select name = "card_type"><option>VISA<option>MasterCard<option>American Express</select></td>
</tr>
<tr>
<td><font face="MS Sans Serif" size=3 style="margin: 1cm">?????????????????</font></td>
<td><input type = text name ="card_number" value = "" maxlength = 16 size = 40></td>
</tr>
<tr>
<td><font face="MS Sans Serif" size=3 style="margin: 1cm">???? AMEX </font></td>
<td><input type = text name = "card_code" value = "" maxlength = 4 size = 4></td>
</tr>
<tr>
<td><font face="MS Sans Serif" size=3 style="margin: 1cm">?????????? </font></td>
<td><font face="MS Sans Serif" size=3>?????</font> <select name = "card_month"><option>01<option>02<option>03<option>04<option>05<option>06<option>07<option>08<option>09<option>10<option>11<option>12</select>
<font face="MS Sans Serif" size=3>?? </font><select name = "card_year"><option>02<option>03<option>04<option>05<option>06<option>07<option>08<option>09<option>10</select></td>
</tr>
<tr>
<td><font face="MS Sans Serif" size=3 style="margin: 1cm">????????????????</font></td>
<td><input type = text name = card_name value = "<?=$name?>" maxlength = 40 size = 40></td>
</tr>
<tr>
<td colspan = 2 align = center>
<br><b><font face="Ms Sans serif" size="2">??????????? ?????????????? ??????????????????? ??????????????? ????????????????? ???????????????????????</font></b>
</td>
</tr>
<tr>
<td align="center"><input value="??????????????" type="submit"></td>
</form>
<form action="../chapter20/home.php" method="post">
<td align="center"><input type ="submit" value="?????????????????"></td></form>
</tr>
</table>
<?
}
//=============================================================================
//?????????????????????????????????
function insert_order($order_details)
{
global $total_price;
global $cart;
extract($order_details);
//???????????????????????????????????????????????
if(!$ship_name&&!$ship_surname&&!$ship_address&&!$ship_phone&&!$ship_district&&!$ship_province&&!$ship_zip&&!$ship_country)
{
$ship_name = $name;
$ship_surname = $surname;
$ship_address = $address;
$ship_phone =$phone;
$ship_district = $district;
$ship_province = $province;
$ship_zip = $zip;
$ship_country = $country;
}
$conn = connect_db("order_book");
//??????????????????????????
$sql = "select customerid from customer where name = '$name' and surname = '$surname' and address = '$address' and district = '$district' and province = '$province' and zip = '$zip' and country = '$country' and phone='$phone' ";
$result = mysql_query($sql);
if(!$result)
return "?????????????? ???????? <br>";
if(mysql_num_rows($result)>0)
{
$customer_id = mysql_result($result, 0, "customerid");
}
else
{
$sql = "insert into customer(name,surname,address,district,province,zip,country,phone) values ( '$name','$surname','$address','$district','$province','$zip','$country','$phone')";
$result = mysql_query($sql);
if (!$result)
return false;
}
$sql = "select customerid from customer where name = '$name' and surname = '$surname' and address = '$address' and district = '$district' and province = '$province' and zip = '$zip' and country = '$country' and phone='$phone'";
$result = mysql_query($sql);
if(!$result)
return "?????????????? ???????? <br>";
if(mysql_num_rows($result)>0)
$customerid = mysql_result($result, 0, "customerid");
else
return false;
$date = date("Y-m-d");
$sql = "insert into orders values
('', $customerid, $total_price, '$date', '$ship_name','$ship_surname',
'$ship_address','$ship_district','$ship_province','$ship_zip',
'$ship_country','$ship_phone')";
$result = mysql_query($sql);
if (!$result)
return false;
$sql = "select orderid from orders where customerid = $customerid and amount > $total_price-.001 and amount < $total_price+.001 and date = '$date' and ship_name = '$ship_name' and ship_surname = '$ship_surname' and ship_address = '$ship_address' and ship_district = '$ship_district' and ship_province = '$ship_province' and ship_zip = '$ship_zip' and ship_country = '$ship_country' and ship_phone ='$ship_phone'";
$result = mysql_query($sql);
if(mysql_num_rows($result)>0)
$orderid = mysql_result($result, 0, "orderid");
else
return false;
// ?????????????????????????????????
foreach ($cart as $isbn => $qty)
{
$book = get_book_details($isbn);
$price = $book["price"];
$conn = connect_db("order_book");
$sql="insert into order_items values ($orderid,'$isbn',$price,$qty)";
$result = mysql_query($sql);
if(!$result)
return false;
}
return $orderid;
}
//=============================================================================
function get_book_details($isbn)
{
if (!$isbn || $isbn=="")
return false;
$con=connect_db("bookonline");
$query = "select * from books where isbn='$isbn'";
$result = mysql_query($query);
if (!$result)
return false;
$result = mysql_fetch_array($result);
return $result;
}
//=================================================================================
function process_card($detailcart)
{
extract($detailcart); if($card_name&&$card_type&&$card_number&&$card_code&&$card_month&&$card_year)
return true;
else
return false;
}
function ship_cost()
{
return 50;
}
//=================================================================================
function register($username,$password,$answer,$email)
{
$con=connect_db("bookonline");
if(!$con)
return "?????????????????????????????? ???????????????????";
$sql = "select * from users where username='$username'";
$result = mysql_query($sql);
if(!$result)
return "?????????????? ???????? <br>";
if(mysql_num_rows($result)>0)
return "?????????????????????????????? <br>";
$result = mysql_query("insert into users values ('$username',password('$password'),'$answer','$email')");
if(!$result)
return("?????????????????????");
else
return true;
}
//=============================================================================
function insert_seawrite($writeid,$writer,$books,$type,$year)
{
$con=connect_db("bookonline");
if(!$con)
{
return "?????????????????????????????? ???????????????????";
exit;
}
$sql = "select * from seawrite where writeid='$writeid'";
$result = mysql_query($sql);
if(!$result)
return "?????????????? ???????? <br>";
if(mysql_num_rows($result)>0)
return "?????????????????????????????? <br>";
$result = mysql_query("insert into seawrite values('$writeid','$writer','$books','$type','$year')");
if(!$result)
return("??????????????????????????????");
else
return true;
}
//=========================================================================
function show_data($tablename)
{
$conn = connect_db("bookonline");
if(!$conn)
echo "?????????????????????????????????????????????";
$sql = "select * from $tablename";
$result = mysql_query($sql);
if(!$result)
return 0;
else
return $result;
}
?>
ไฟล์ check_data.php
<?
function check_valid_user()
{
global $valid_user;
if (!isset($_SESSION["valid_user"]))
$str = "<tr><td colspan=\"3\"><font face = \"MS Sans Serif\" color=\"#000000\" size=\"3\"> ??????????????? $valid_user</font></td></tr>";
else
$str = "<center>????????????????</center><br>";
return $str;
}
//=============================================================================
function filled_out($form_vars)
{
if(!is_array(form_vars) or count(form_vars) == 0) return false;
foreach($form_vars as $key=>$value);
{
if(!isset($key)||($value==""))
return false;
}
return true;
}
//==========================================================================
function check_admin()
{
global $authuser;
if (!isset($_SESSION["authuser"]))
{
echo "<tr><td><center>????????????????????? $authuser</center>";
echo "</td></tr>";
return true;
}
else
{
echo "<tr><td><center>???????????????? $authuser</center></td></tr>";
return false;
exit;
}
}
//========================================================================
function valid_email($add)
{
//?????????????
if(ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]",$add))
return true;
else
return false;
}
?>
Tag : - - - -
|
|
|
|
|
|
Date :
2009-04-09 14:31:10 |
By :
baby |
View :
1193 |
Reply :
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
มันฟ้องว่า php มันไม่รู้จัง function header_html() นิครับ
|
|
|
|
|
Date :
2009-04-09 14:47:43 |
By :
windersun |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
วิธีแก้ยังไงเหรอครับ ผมไม่ค่อยเป็นครับ ขอบคุณครับ
|
|
|
|
|
Date :
2009-04-09 14:55:54 |
By :
ิbaby |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
header_html("การป้อนข้อมูลเกิดความผิดพลาด"); <<== มันเป็นฟังช์อะไรเหรอครับ พอดีสคริปนี้มันบอกว่า ไม่รู้จัก หรือ ฟังชั่นก์นี้ไม่มี ให้ตรวจสอบว่า ฟังชั่นก์ นี่อ่ะคับ ได้มีการประกาศ หรือ สร้างไว้หรือเปล่า...
|
|
|
|
|
Date :
2009-04-09 15:02:55 |
By :
noomna19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ใช่ไฟล์นี้ป่าวครับ headeradmin.php
<?
function header_admin($title)
{
//แสดงส่วนของ header html
?>
<html>
<head>
<title><?=$title?></title>
<style>
body {font-family:Microsoft Sans Serif ,MS Sans Serif ,Arial ,CordiaUPC ; font-size: 13px }
li,td {font-family : sans - serif , Arial ; font-size : 13px}
hr {color:#3333cc ; width = 700; text-align = left}
a.noline {COLOR: #ffffcc; TEXT-DECORATION: none }
a.noline:hover { COLOR: #99cc99}
a.cate {text-decoration:none; color: #FFFFFF;}
a.cate:hover {color:"EE9935";}
a.menu {text-decoration:none; color: "#6600FF";}
a.menu:hover {color:"#FF6600";}
a.shop {color: "#6600FF";}
a.shop:hover {color:"#FF6600";}
</style>
</head>
<body>
<table width="760">
<tr ><td align="left" width="100">
<td align="center">
<img src="../image/header.gif" border="0" width="750" height="100"></td>
</tr>
</table>
<table>
<tr><td bgcolor=#3366CC width=850 height=25 align="right">
<font face = "MS Sans Serif"size="3">
<a class ="cate" href="../chapter19/home.php"><b>???????</b></a><font color="#FFFFFF"> |</font>
<a class ="cate" href="../chapter19/insertbook_form.php"><b>เพิ่มหนังสือ</b></a><font color="#FFFFFF"> | </font>
<a class ="cate" href="../chapter19/modify_form.php"><b>แกไข้หนังสือ</b></a><font color="#FFFFFF"> | </font>
<a class ="cate" href="../chapter19/catebook_form.php"><b>จัดหมวดหมู่หนังสือ</b></a><font color="#FFFFFF"> | </font>
<a class ="cate" href="../chapter19/logout_admin.php?status=logout"><b>ลอคเอาท์</b></a>
</td>
</tr>
</table>
<?
}
?>
|
|
|
|
|
Date :
2009-04-09 15:19:09 |
By :
baby |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
header_html ครับไม่ใช่ header_admin
เจอแล้วก็ include ไฟล์นี้ในไฟล์ที่ error
|
|
|
|
|
Date :
2009-04-09 15:22:41 |
By :
plakrim |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไฟล์ header.php ใช่ไหมครับ
แล้วที่ว่า..include ไฟล์นี้ในไฟล์ที่ error ยังไงเหรอครับ รบกวนด้วยครับ
<?
function header_html($title)
{
//??????????? header ?? html
?>
<html>
<head>
<title><?=$title?></title>
<style>
body {font-family:Microsoft Sans Serif ,MS Sans Serif ,Arial ,CordiaUPC ; font-size: 13px }
li,td {font-family : sans - serif , Arial ; font-size : 13px}
hr {color:#3333cc ; width = 700; text-align = left}
a.noline {COLOR: #ffffcc; TEXT-DECORATION: none }
a.noline:hover { COLOR: #99cc99}
a.cate {text-decoration:none; color: #FFFFFF;}
a.cate:hover {color:"EE9935";}
a.menu {text-decoration:none; color: "#6600FF";}
a.menu:hover {color:"#FF6600";}
a.shop {color: "#6600FF";}
a.shop:hover {color:"#FF6600";}
a.lmenu {color: "#660099"; text-decoration:none;}
a.lmenu:hover {color:"#FF6600"; text-decoration:none;}
</style>
</head>
<body>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr >
<td align="center">
<img src="../image/header.gif" border="0" width="750" height="100"></td>
</tr>
<tr>
<td bgcolor=#3366CC width=750 height=25 align="right">
<font face = "MS Sans Serif"size="2">
<a class ="cate" href="../chapter19/home.php"><b>???????</b></a><font color="#FFFFFF"> |</font>
<a class ="cate" href="../chapter19/admin_form.php"><b>???????????</b></a><font > </td></tr>
<?
}
?>
|
|
|
|
|
Date :
2009-04-09 15:34:30 |
By :
baby |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require_once("../include/connect_db.php");
require_once("../include/function.php");
require_once("../chapter19/headeradmin.php");
require_once("../include/header.php"); <== เอามาใส่ตรงนี้ครับ...
require_once("../include/check_data.php");
|
|
|
|
|
Date :
2009-04-09 15:44:27 |
By :
noomna19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
รันแล้ว กลายเป็นแบบนี้ซะงั้น T.T
รูปภา่พ
|
|
|
|
|
Date :
2009-04-09 15:49:51 |
By :
ิbaby |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เลือกเอาสักอย่างระหว่าง headeradmin กับ header
|
|
|
|
|
Date :
2009-04-09 15:53:15 |
By :
plakrim |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ก้อเพราะว่า
<?
require_once("../include/connect_db.php");
require_once("../include/function.php");
require_once("../chapter19/headeradmin.php");
require_once("../include/check_data.php");
session_start();
header_admin("ลบรายการหนังสือ"); <== คุณเรียก head ของ Admin มาแสดง
if(!filled_out($HTTP_POST_VARS))
{
echo "เกิดความผิดพลาดในการป้อนรายละเอียด กรุณาตรวจสอบอีกครั้ง";
header_html("การป้อนข้อมูลเกิดความผิดพลาด"); <==แล้วยังเรียก head ธรรมดามาแสดง อีกที
require_once("../include/footer.php");
exit;
}
if (check_admin())
{
if(delete_book($isbn))
echo "<center>ลบหนังสือ ISBN '$isbn' ในฐานข้อมูลเรียบร้อย</center>";
else
echo " <center>หนังสือชื่อ '$isbn' ไม่สามารถลบในฐานข้อมูลได้</center>";
}
else
echo "คุณไม่มีสิทธิลบข้อมูล";
require_once("../include/footer.php");
?>
มันก้อเลยแสดงออกมาเป็น สองหัวแบบนั้นแหละครับ ลองลบหัวที่ไม่ต้องการ ออกสิครับ
|
|
|
|
|
Date :
2009-04-09 15:57:27 |
By :
noomna19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
พอเลือกเอา header ไว้
มันขึ้น Fatal error: Call to undefined function header_admin() inC:\AppServ\www\projectbook\chapter19\deletebook.php online 8
|
|
|
|
|
Date :
2009-04-09 15:59:03 |
By :
ิbaby |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
อ่อ อย่างงี้นี้เองครับ
แล้วทำไมมันยังขึ้น เกิดความผิดพลาดในการป้อนรายละเอียด กรุณาตรวจสอบอีกครั้ง อยู่ครับ
|
|
|
|
|
Date :
2009-04-09 16:01:59 |
By :
ิbaby |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ง่ะ ผมหมายถึงให้ลบแถวที่ผม แดง ๆ ไว้อ่ะครับ แถวใดแถวหนึ่ง (แนะนำลบ header_html ออกดีกว่า) ส่วนตรง require ไม่ต้องไปลบมาน - -''
|
|
|
|
|
Date :
2009-04-09 16:03:02 |
By :
noomna19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5555 ครับ ตรงนั้นเข้าใจแล้วครับ
อยากรู้ว่าทำไมมันขึ้น เกิดความผิดพลาดในการป้อนรายละเอียด กรุณาตรวจสอบอีกครั้ง ครับ ^^"
|
|
|
|
|
Date :
2009-04-09 16:05:57 |
By :
ิbaby |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|