|
|
|
รบกวนดูโค้ดเพิ่มรูปให้ทีค่ะ ระหว่าง 2 รูป ก๊อปปี้รูปลงโฟเดอร์ได้แล้วแต่ข้อมูลไม่ลงฐานข้อมูลค่ะ |
|
|
|
|
|
|
|
คือมันเพิ่มรูปเข้าโพลเดอร์ได้ทั้งสองรูป แต่ข้อมูลมันไม่ลงฐานเลยค่ะข้อมูลค่ะ
Code (PHP)
<?
include("../connect.php");
?>
<!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>Untitled Document</title>
<style type="text/css">
body,td,th {
color: #666;
font-family: "Courier New", Courier, monospace;
font-size: 14px;
}
</style>
</head>
<body>
<body bgcolor="#f9e9f2">
<table width="65%" border="0" align="center" bgcolor="#FFFFFF">
<tr>
<td>
<?php require_once('head.php'); ?>
</td>
</tr>
<tr>
<td>
<?php require_once('headmanu.php'); ?>
</td>
</tr>
<tr>
<td align="left"valign="top" bgcolor="#FFFFFF" div><div align="center">
<table border= "0 " bgcolor="#FCE294" div align="center">
<form name="addproduct" action="admin_add_action.php" method="post" enctype="multipart/form-data">
<tr><td div align="center">รหัสสินค้า</td><td><input name= "product_id" size= "20 " ></td><tr>
<tr><td div align="center">รายละเอียด</td>
<td><textarea name="product_detail" id="textarea" cols="45" rows="5"></textarea></td><tr>
<tr><td div align="center">ราคา</td><td><input name="price" size= "10 " ></td><tr>
<tr><td>รูปสินค้า</td><td><input type='file' name="picture"> </td><tr>
<tr><td>รูปรายละเอียด</td><td><input type='file' name="picture2"> </td><tr>
<tr><td colspan= "2"><center><INPUT TYPE='SUBMIT' VALUE = "เพิ่ม">
<INPUT TYPE='RESET' VALUE = "RESET"> </center></td></tr>
</form>
</table>
</center>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
action.php
Code (PHP)
<?
$up1 = move_uploaded_file($_FILES["picture"]["tmp_name"],"../img/wall/".$_FILES["picture"]["name"]);
$up2 = move_uploaded_file($_FILES["picture2"]["tmp_name"],"../img/wall2/".$_FILES["picture2"]["name"]);
if($up1 && $up2)
{
echo "Copy/Upload Complete<br>";
//*** Insert Record ***//
$objConnect = mysql_connect("localhost","root","12345678") or die("Error Connect to Database");
$objDB = mysql_select_db("data");
$strSQL = "insert into product (product_id,product_detail,price,picture,picture2) values ('$product_id','$product_detail','$price','$picture','$picture2')";
$objQuery = mysql_query($strSQL);
}
?>
Tag : PHP
|
|
|
|
|
|
Date :
2012-06-22 14:31:12 |
By :
chanidam |
View :
799 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
$strSQL = "insert into product (product_id,product_detail,price,picture,picture2) values ('$product_id','$product_detail','$price','$picture','$picture2')";
$picture,$picture2 มีค่าแล้วหรือครับ มันต้องเป็น $_FILES["picture"] , $_FILES["picture2"] หรือเปล่า
|
|
|
|
|
Date :
2012-06-22 14:55:29 |
By :
randOmizE |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|