|
 |
|
ผมอัพไฟล์ขึ้นเว็บแล้วอะครับแล้วมันไม่ copy รูปลง folder ให้อะครับ |
|
 |
|
|
 |
 |
|
ตอนกรอกข้อมูล

code ตอน insert
Code (PHP)
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>เพิ่มข้อมูลเรียบร้อย</title>
</head>
<body>
<? //check data
if($_POST["txtName"]=='' || $_POST["txtName"]<'A' || $_POST["txtName"]>'Z' && $_POST["txtName"]<'a' || $_POST["txtName"]>'z' && $_POST["txtName"]<'ก' || $_POST["txtName"]>'์')
{ echo "<center>ชื่อต้องเป็นตัวอักษรภาษาไทยหรืออังกฤษเท่านั้น</center><br>";}
else if($_POST["txtBirth"]=='' || $_POST["txtBirth"]<'/' || $_POST["txtBirth"]>'9')
{ echo "<center>กรุณาใส่วันเกิดให้ถูกรูปแบบ</center><br>"; }
else if($_POST["txtAddress"]=='')
{ echo "<center>กรุณาใส่ที่อยู่ด้วย</center><br>";}
else if($_POST["txtPhone"]=='' || (int)$_POST["txtPhone"]<9999999 || (int)$_POST["txtPhone"]>10000000000)
{ echo "<center><font color='red'>กรุณาใส่เบอร์โทรศัพท์ให้ถูกต้อง</font></center><br>";}
else if($_POST["txtType"]=='')
{ echo "<center>กรุณาใส่ประเภทบุคลากร</center><br>";}
else if($_POST["txtPosition"]=='')
{ echo "<center>กรุณาใส่ตำแหน่ง</center><br>";}
else if($_POST["txtUnit"]=='')
{ echo "<center>กรุณาใส่หน่วยงาน</center><br>";}
else if($_POST["txtSkill"]=='')
{ echo "<center>กรุณาใส่ความถนัดหรือความเชี่ยวชาญ</center><br>";}
else if($_POST["txtEdu"]=='')
{ echo "<center>กรุณาใส่วุฒิการศึกษา</center><br>";}
else if($_POST["txtSchool"]=='')
{ echo "<center>กรุณาใส่สถานที่ศึกษา</center><br>";}
else if($_POST["txtReligion"]=='')
{ echo "<center>กรุณาใส่ศาสนา</center><br>";}
else if($_POST["txtJoin"]=='' || $_POST["txtJoin"]<'/' || $_POST["txtJoin"]>'9')
{ echo "<center>กรุณาใส่วันที่เข้าทำงานให้ถูกต้อง</center><br>";}
//copy picture to folder
else if(copy($_FILES["filUpload"]["tmp_name"],"images/".$_FILES["filUpload"]["name"]))
{
echo "<center>การใส่ข้อมูลเรียบร้อย</center><br>";
// Insert
$objConnect = mysql_connect("localhost","501333","123456") or die("Error Connect to Database");
$objDB = mysql_select_db("501333");
$strSQL = "INSERT INTO files ";
$strSQL .="(Name,Birth,Address,Phone,Type,Position,Unit,Skill, Edu,School,Email,Religion,kao,FilesName) VALUES ('".$_POST["txtName"]."','".$_POST["txtBirth"]."','".$_POST["txtAddress"]."', '".$_POST["txtPhone"]."','".$_POST["txtType"]."','".$_POST["txtPosition"]."' ,'".$_POST["txtUnit"]."','".$_POST["txtSkill"]."','".$_POST["txtEdu"]."', '".$_POST["txtSchool"]."','".$_POST["txtEmail"]."','".$_POST["txtReligion"]."', '".$_POST["txtJoin"]."','".$_FILES["filUpload"]["name"]."')";
$objQuery = mysql_query($strSQL);
}
else
{echo "<center>กรุณาเลือกรูปภาพ</center><br>";}
?>
<table width="251" border="0" align="center">
<tr>
<td width="115"><a href="insert.php">
<input type="submit" name="button" id="button" value="กลับหน้าเพิ่มข้อมูล">
</a></td>
<td width="126" align="center"><a href="show.php"><input type="submit" name="button2" id="button2" value="ดูข้อมูล"></a></td>
</tr>
</table>
</body>Code (PHP)
</html>
ภาพfolder ในเว็บ

เหมือนกับว่าช่อง upload file มันไม่ส่งค่ามาให้หน้าinsert อะครับ
ขอบคุณครับ
Tag : PHP, MySQL

|
|
 |
 |
 |
 |
Date :
2012-05-23 11:06:32 |
By :
newbie |
View :
929 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เปลี่ยน CMOS 777 หรือยังครับ
|
 |
 |
 |
 |
Date :
2012-05-23 11:13:36 |
By :
pumin99 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับขอบคุณมากครับ  
|
 |
 |
 |
 |
Date :
2012-05-23 11:16:40 |
By :
newbie |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|