|
 |
|
เซียนอับโหลดรุปช่วยด้วยยยยยยยยยยยยยยยย ข้อมูล อับโหลดรูป มาน ไม่มาโชวอ่า ครับ งงมาก |
|
 |
|
|
 |
 |
|
Code (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></head>
<body>
<? include "connect.inc.php"; ?>
<form id="form1" name="form1" method="post" action="equipment_add2.php">
<table width="467" height="459" border="0" align="center">
<tr>
<td colspan="2"><div align="center"><strong>เพิ่ม เครื่องมือ/อุปกรณ สู่รายการให้เช่า </strong></div></td>
</tr>
<tr>
<td width="190" height="29"><strong>ชื่อ เครื่องมือ/อุปกรณ์</strong></td>
<td width="261"><input name="name_equ" type="text" id="name_equ" /></td>
</tr>
<tr>
<td height="31"><strong>ประเภท</strong></td>
<td><select name="type" id="type_equ">
<option value="0">--เลือกประเภทสินค้า--</option>
<?
$sql="select * from equipment_type";
$result=mysql_db_query($dbname,$sql);
while($rs=mysql_fetch_array($result)) {
$id_type=$rs[id_type];
$name_type=$rs[name_type];
echo "<OPTION VALUE='$id_type'>$name_type</OPTION>";
}
?>
</select></td>
</tr>
<tr>
<td height="30"><strong>กลุ่ม</strong></td>
<td><select name="group" id="group_equ">
<option value="0">--เลือกกลุ่มสินค้า--</option>
<?
$sql="select * from equipment_group";
$result=mysql_db_query($dbname,$sql);
while($rs=mysql_fetch_array($result)) {
$id_group=$rs[id_group];
$name_group=$rs[name_group];
echo "<OPTION VALUE='$id_group'>$name_group</OPTION>";
}
?>
</select></td>
</tr>
<tr>
<td height="31"><strong>Product code </strong></td>
<td><input name="code" type="text" /></td>
</tr>
<tr>
<td height="32"><strong>ยี่ห้อ</strong></td>
<td><input name="brand" type="text" /></td>
</tr>
<tr>
<td height="37"><strong>MODEL</strong></td>
<td><input name="model" type="text" /></td>
</tr>
<tr>
<td height="140"><strong>รายละเเอียด</strong></td>
<td><textarea name="detail" cols="40" rows="8" ></textarea></td>
</tr>
<tr>
<td><strong>ราคา ต่อวัน </strong></td>
<td><input name="price_day" type="text" />
บาท </td>
</tr>
<tr>
<td><strong>ราคาต่อเดือน</strong></td>
<td><input name="price_month" type="text" />
บาท</td>
</tr>
<TR>
<TD>รูปภาพ</TD>
<TD><INPUT NAME="photo" TYPE="file" id="photo">
<INPUT NAME="MAX_FILES_SIZE" TYPE="hidden" id="MAX_FILES_SIZE" VALUE="100000"></TD>
</TR>
<tr>
<td><div align="right">
<input type="submit" name="Submit" value="เพิ่มอุปกรณ์" />
</div></td>
<td><div align="left">
<input type="reset" name="Submit2" value="ล้างข้อมูล" />
</div></td>
</tr>
</table>
</form>
</body>
</html>

นี่คือหน้า อับโหลด ต่อไปหน้า
Code (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>
</head>
<body>
<?
$name=$_POST[name_equ];
$type=$_POST[type];
$group=$_POST[group];
$code=$_POST[code];
$brand=$_POST[brand];
$model=$_POST[model];
$detail=$_POST[detail];
$price_day=$_POST[price_day];
$price_month=$_POST[price_month];
$photo=$_FILES['photo']['tmp_name'];
$photo_name=$_FILES['photo']['name'];
$photo_size=$_FILES['photo']['size'];
$photo_type=$_FILES['photo']['type'];
echo"$name $type $group $code $brand $model $detail $price_day $price_month ";
if ($name=="") {
echo "<H3>ERROR : กรุณากรอก เครื่องมือ/อุปกรณ </H3>";
exit();
} else if ($type=="0") {
echo "<H3>ERROR : กรุณาเลือก ประเภท เครื่องมือ/อุปกรณ /H3>";
exit();
} else if ($group=="0") {
echo "<H3>ERROR : กรุณาเลือกกลุ่ม เครื่องมือ/อุปกรณ </H3>";
exit();
} else if ($code=="") {
echo "<H3>ERROR : กรุณากรอก Productcode</H3>";
exit();
} else if ($price_day=="") {
echo "<H3>ERROR : กรุณากรอก ราคาเช่าต่อวัน</H3>";
exit();
} else if ($price_month=="") {
echo "<H3>ERROR : กรุณากรอก ราคาเช่าต่อเดือน</H3>";
exit();
}
include "connect.inc.php";
$sql="INSERT INTO equipment values('','$name','$type','$group','$code','$brand','$model','$detail','$price_day','$price_month','') ";
$result=mysql_db_query($dbname,$sql);
if ($photo) {
$array_last=explode(".",$fileupload_name);
$c=count($array_last)-1;
$lastname=strtolower($array_last[$c]) ;
if ($lastname=="gif" or $lastname=="jpg" or $lastname=="jpeg") {
$sql2="select max(id) from equipment ";
$result2=mysql_db_query($dbname,$sql2);
$row=mysql_fetch_row($result2);
$photoname=$row[0].".".$lastname;
copy($photo,"images/".$photoname);
$sql3="update equipment set photo='$photoname' where id ='$row[0]' ";
$result3=mysql_db_query($dbname,$sql3);
}
unlink($photo);
}
echo "<H3>เพิ่ม เครื่องมือ/อุปกรณ เสร็จเรียบร้อย</H3>";
echo "[ <A HREF=equipment_add.php>กลับหน้าหลัก</A> ] ";
mysql_close();
?>
</body>
</html>
นี่คือหน้าประกาสตัวแปร


ข้อมูล อับโหลดรูป มาน ไม่มาโชวอ่า ครับ งงมาก
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-10-07 19:11:45 |
By :
wave777 |
View :
979 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
- -*
|
 |
 |
 |
 |
Date :
2009-10-08 07:40:59 |
By :
wave777 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
enctype="multipart/form-data" ตัวสำคัญคับ
|
 |
 |
 |
 |
Date :
2009-10-08 10:04:57 |
By :
apicha31 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เงียบไป สงสัย แก้ได้แล้ว 
|
 |
 |
 |
 |
Date :
2009-10-08 13:17:59 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|