|
|
|
อัพโหลดรูปภาพลงฐานข้อมูลตอนแรกทำได้ แต่พอตอนนี้ทำไม่ได้ทั้ง ๆ ที่โค้ดเดิม |
|
|
|
|
|
|
|
code ละครับ ?
|
|
|
|
|
Date :
2011-04-25 18:59:02 |
By :
- - |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<table width="81%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr align="center">
<td colspan="3"><?php
$id_exp=$_POST['id_exp'];
$type_product=$_POST['type_product'];
$name=$_POST['name'];
$photo=$_POST['photo'];
$price_pro=$_POST['price_pro'];
$price=$_POST['price'];
$status=$_POST['status'];
$detail=$_POST['detail'];
$realname = $HTTP_POST_FILES['photo']['name'];
if(is_uploaded_file($HTTP_POST_FILES['photo']['jpg_name']))
{
copy($HTTP_POST_FILES['photo']['jpg_name'],"../pawnshop/img/$realname");
$URL="$realname";
$Filename=$HTTP_POST_FILES['photo']['jpg_name'];
}
include "connect.php"; // ติดต่อฐานข้อมูล
$sql="SELECT * FROM pawn_exp where id_exp='$id_exp'";
$result=mysql_db_query($db,$sql);
$sql="INSERT INTO pawn_exp values ('$id_exp','$type_product','$name','$photo','$price_pro','$price','$status','$detail')";
$result=mysql_db_query($db,$sql);
if ($result)
{
echo "<h3><center>ข้อมูลถูกบันทึกลงฐานข้อมูลเรียบร้อยแล้ว</center></h3><br />";
}
else {
echo "ไม่สามารถบันทึกข้อมูลลงฐานข้อมูลได้ กรุณาตรวจสอบอีกครั้ง<br>";
echo "<A HREF='pawn.php'>ย้อนกลับ</A>";
}
$realname = $HTTP_POST_FILES['photo']['name'];
if(is_uploaded_file($HTTP_POST_FILES['photo']['jpg_name']))
{
copy($HTTP_POST_FILES['photo']['jpg_name'],"../pawnshop/img/$realname");
$URL="$realname";
$Filename=$HTTP_POST_FILES['photo']['jpg_name'];
}
mysql_close( );
?></td>
</tr>
<tr>
<td class="style7"><br />
<span class="style3">ประเภททรัพย์</span></td>
<td class="textfont"><?=$type_product?></td>
</tr>
<tr>
<td class="style7"><br />
<span class="style3">ชื่อทรัพย์</span></td>
<td class="textfont"><?=$name?></td>
</tr>
<tr>
<td class="style7"><br />
<span class="style3">รูปภาพ</span></td>
<td class="textfont"><IMG SRC="img/<?php echo "$photo";?>" width="130" height="150" />
</td>
</tr>
<tr>
<td class="style7"><br />
<span class="style3">ราคาทรัพย์ที่ตกลงประเมิน</span></td>
<td class="textfont"><?=$price_pro?></td>
</tr>
<tr>
<td class="style7"><br />
<span class="style3">ราคา</span></td>
<td class="textfont"><?=$price?></td>
</tr>
<tr>
<td class="style7"><br />
<span class="style3">สถานะทรัพย์</span></td>
<td class="textfont"><?=$status?></td>
</tr>
<tr>
<td class="style7"><br />
<span class="style3">หมายเหตุ</span></td>
<td class="textfont"><?=$detail?></td>
</tr>
<tr>
<td class="style7"></td>
</tr>
</table></form>
|
|
|
|
|
Date :
2011-04-25 19:00:01 |
By :
parn |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|