|
 |
|
ช่วยหน่อยนะค่ะ ช่องแสดงรูปสินค้าไม่ขึ้นค่ะ ไม่รู้จะทำยังไงดีค่ะ รบกวนด้วยค่ะ |
|
 |
|
|
 |
 |
|
แทรก Tags ของรูป <img src="path<?=$img_name;?>"> ครับ
|
 |
 |
 |
 |
Date :
2012-02-29 08:46:50 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
จำได้ว่าเคยบอกไปแล้ว ยังไม่ได้อีกเหรอคะ
|
 |
 |
 |
 |
Date :
2012-02-29 09:54:27 |
By :
teukkead |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช่ๆๆ ยังไม่ได้เลยค่ะ...เหอๆๆ....
|
 |
 |
 |
 |
Date :
2012-02-29 12:07:51 |
By :
naja |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอาโค้ดที่แสดงรูปที่อัพมาใ้ห้ดูหนอ่ย แล้วเอาชื่อโฟล์เดอร์ที่เก็บรูปไว้ด้วยค่ะ
|
 |
 |
 |
 |
Date :
2012-02-29 12:44:34 |
By :
teukkead |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (ASP)
<?
include "chksession_admin.php";
?>
<?
$host= "127.0.0.1";
$user ="root";
$passwd ="12345678";
$dbname="e_comerceoilshop";
$link= mysql_connect($host,$user,$passwd) or die ("เชื่อมต่อโฮสต์ไม่ได้");
mysql_select_db($dbname) or die ("เชื่อมต่อฐานข้อมูลไม่ได้");
$link = mysql_connect($host,$user,$passwd);
mysql_query("set names utf8");
$sql="use e_comerceoilshop ";
$sql ="Select * From product order by id_prd desc" ;
$result= mysql_db_query($dbname,$sql);
$number = mysql_num_rows($result);
$no=1;
?>
<!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=utf-8" />
<title>OilShop_E-commerch:: สำหรับผู้ดูแลระบบ</title>
</head>
<body>
<center>
<p> </p>
<p> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center">
<?
include "admin_menu.php";
if ($number <> 0 ) {
echo "
<P><strong>แสดงสินค้า </strong></p>
<table border=1>
<tr bgcolor =#E8E8E8 >
<TD><center><b>รหัสสินค้า</b></center></td>
<TD><center><b>สินค้า</b></center></td>
<TD><center><b>ประเภทสินค้า</b></center></td>
<TD><center><b>ราคาสินค้า</b></center></td>
<TD><center><b>รูปสินค้า</b></center></td>
<TD><center><b>[แก้ไข]</b></center></td>
<TD><center><b>[ลบ]</b></center></td>
</tr> ";
while ($rs=mysql_fetch_array($result))
{
$id_prd=$rs[id_prd];
$code_prd=sprintf("%05d",$id_prd);
$name_prd=$rs[name_prd];
$detial_prd=$rs[detail_prd];
$ref_id_type=$rs[ref_id_type];
$price_prd = $rs[price_prd];
$photo_prd=$rs[photo_prd];
$sql2 ="select Type_Name from type where Type_ID='$ref_id_type' ";
$result2 = mysql_db_query($dbname,$sql2);
$rs2 = mysql_fetch_array($result2);
$name_type=$rs2[Type_Name];
echo "
<TR>
<TD> $code_prd </td>
<td>$name_prd</td>
<td>$name_type</td>
<td>$price_prd</td>
<td><a href='photo/$photo_prd' Target ='_blank'>$photo_prd</td>
<TD><A HREF =\"admin_product_edit.php?id_edit=$id_prd\">[แก้ไข]</a></td>
<td><A HREF =\"admin_product_delete.php?id_del=$id_prd&photo_del=$photo_prd\"
onclick=\"return confirm ('ยืนยันการลบสินค้า $name_prd ออกจากระบบ')\">[ลบ] </a></td>
</TR>
</TR>";
$no++;
}
echo "</table>";
mysql_close();
}
?>
</p>
<p> </p>
<p> </p>
</center>
</body>
</html>
พอใส่โค้ดคราวที่แล้วมัน error ก็เลยต้องทำแบบเดิมไปส่งอาจารย์ก่อนค่ะ แต่จารย์เขาอยากให้แสดงรูป ก็เลย...ต้องมาใหม่อีกรอบ ที่เก็บรูปภาพคือ Computer>Local Disk(C:)>AppServ>www>Oilshop>photo
ขอบคุณมากๆๆจริงๆๆนะค่ะ ที่ช่วยเหลือ
|
 |
 |
 |
 |
Date :
2012-02-29 17:25:09 |
By :
katay |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<img src="ชื่อโฟล์เดอร์เก็บรูป/<?=$result[' ชื่อฟิลด์ที่เก็บชื่อรูป '];;?>">
|
 |
 |
 |
 |
Date :
2012-02-29 17:29:41 |
By :
ozma |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<a href="photo/<?=$photo_prd;?>" Target ='_blank'><img src="photo/<?=$photo_prd;?>" width="15" height="15" /></a>
|
ประวัติการแก้ไข 2012-02-29 17:40:16
 |
 |
 |
 |
Date :
2012-02-29 17:38:06 |
By :
teukkead |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากๆค่ะ เดี๋ยวลองไปทำก่อนนะค่ะ เขียนโค้ดไม่ค่อยเก่ง....อย่าเบื่อนะค่ะ
|
 |
 |
 |
 |
Date :
2012-02-29 23:34:33 |
By :
katay |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มัน error ค่ะ ...

Code (PHP)
<?
include "chksession_admin.php";
?>
<?
$host= "127.0.0.1";
$user ="root";
$passwd ="12345678";
$dbname="e_comerceoilshop";
$link= mysql_connect($host,$user,$passwd) or die ("เชื่อมต่อโฮสต์ไม่ได้");
mysql_select_db($dbname) or die ("เชื่อมต่อฐานข้อมูลไม่ได้");
$link = mysql_connect($host,$user,$passwd);
mysql_query("set names utf8");
$sql="use e_comerceoilshop ";
$sql ="Select * From product order by id_prd desc" ;
$result= mysql_db_query($dbname,$sql);
$number = mysql_num_rows($result);
$no=1;
?>
<!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=utf-8" />
<title>OilShop_E-commerch:: สำหรับผู้ดูแลระบบ</title>
</head>
<body>
<center>
<p> </p>
<p> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center">
<?
include "admin_menu.php";
if ($number <> 0 ) {
echo "
<P><strong>แสดงสินค้า </strong></p>
<table border=1>
<tr bgcolor =#E8E8E8 >
<TD><center><b>รหัสสินค้า</b></center></td>
<TD><center><b>สินค้า</b></center></td>
<TD><center><b>ประเภทสินค้า</b></center></td>
<TD><center><b>ราคาสินค้า</b></center></td>
<TD><center><b>รูปสินค้า</b></center></td>
<TD><center><b>[แก้ไข]</b></center></td>
<TD><center><b>[ลบ]</b></center></td>
</tr> ";
while ($rs=mysql_fetch_array($result))
{
$id_prd=$rs[id_prd];
$code_prd=sprintf("%05d",$id_prd);
$name_prd=$rs[name_prd];
$detial_prd=$rs[detail_prd];
$ref_id_type=$rs[ref_id_type];
$price_prd = $rs[price_prd];
$photo_prd=$rs[photo_prd];
$sql2 ="select Type_Name from type where Type_ID='$ref_id_type' ";
$result2 = mysql_db_query($dbname,$sql2);
$rs2 = mysql_fetch_array($result2);
$name_type=$rs2[Type_Name];
echo "
<TR>
<TD> $code_prd </td>
<td>$name_prd</td>
<td>$name_type</td>
<td>$price_prd</td>
<td><a href='photo/$photo_prd' Target ='_blank'>$photo_prd</td>
<TD><A HREF =\"admin_product_edit.php?id_edit=$id_prd\">[แก้ไข]</a></td>
<td><a href="photo/<?=$photo_prd;?>" Target ='_blank'><img src="photo/<?=$photo_prd;?>" width="15" height="15" /></a></td>
onclick=\"return confirm ('ยืนยันการลบสินค้า $name_prd ออกจากระบบ')\">[ลบ] </a></td>
</TR>
</TR>";
$no++;
}
echo "</table>";
mysql_close();
}
?>
</p>
<p> </p>
<p> </p>
</center>
</body>
</html>
|
 |
 |
 |
 |
Date :
2012-03-01 12:11:09 |
By :
katay |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<a href="photo/<?=$photo_prd; ?>" target="_blank" ><img src="photo/<?=$photo_prd; ?>" width="15" height="15" /></a>
|
 |
 |
 |
 |
Date :
2012-03-01 12:17:27 |
By :
teukkead |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|