|
 |
|
ถามเกี่ยวกับการ Uploadรูปขึ้นเว็บคับ PHP จะสามารถเลือกที่เก็บรูปได้ไหม คับ Code ผมประมาณนี้ คับ |
|
 |
|
|
 |
 |
|
ก็คุณลืม copy ไฟล์นะครับ
$path = "pic/"; ที่เก็บรูป
$picName="$_FILES['userfile']['name']"; ชื่อรูป
copy($_FILES['userfile']['tmp_name'],$path.$picName) ก็อปปี้
|
 |
 |
 |
 |
Date :
2009-11-27 10:55:25 |
By :
martman26 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<?
if(copy($_FILES["filUpload"]["tmp_name"],"myfile/".$_FILES["filUpload"]["name"]))
{
echo "Copy/Upload Complete<br>";
//*** Insert Record ***//
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("mydatabase");
$strSQL = "INSERT INTO files ";
$strSQL .="(FilesName) VALUES ('".$_FILES["filUpload"]["name"]."')";
$objQuery = mysql_query($strSQL);
}
?>
<a href="PageUploadToMySQL3.php">View files</a>
</body>
</html>
Ref : https://www.thaicreate.com/php/php-upload-files-mysql.html
|
 |
 |
 |
 |
Date :
2009-11-27 11:16:59 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้ว คับบบบบ ขอบคุณทุกความคิดเห็นที่ช่วยคับบบบบบบบบ
|
 |
 |
 |
 |
Date :
2009-11-27 12:30:29 |
By :
kan27zaa |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|