|
|
|
ช่วยแนะนำหน่อยคับ รูปภาพไม่แสดงผล จะต้องแก้ไขยังงัยคับ |
|
|
|
|
|
|
|
ระบุ Part ผิดรึป่าวครับ เช็คดูๆ
|
|
|
|
|
Date :
2011-10-02 09:03:07 |
By :
arm8957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
พาทของรูปถูกป่าวละครับ ลอกคลิกขวาที่รูป แล้วเลือก "คัดลอก URL" แล้วดูครับ ว่าพาทถูกรึป่าว?
|
|
|
|
|
Date :
2011-10-02 21:28:34 |
By :
arm8957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
งั้นเอาโค๊ดมาดูครับ
|
|
|
|
|
Date :
2011-10-02 23:02:08 |
By :
arm8957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
น่าจะผิดตรงไฟล์ที่สำหรับ show ครับ
|
|
|
|
|
Date :
2011-10-02 23:08:28 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เอาโคดมาให้ดูซิครับ คนตอบจะได้ตอบง่ายขึ้น
|
|
|
|
|
Date :
2011-10-03 08:26:24 |
By :
grandraftz |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ต้องไล่ดูตั้งแต่เอาลงละครับ ว่ามีชื่อ แล้วมีไฟล์หรือเปล่า ถ้าเก็บได้แล้วไม่แสดง ก็เรียกผิดพาท น่าจะมีแค่นั้นเน้อ
|
|
|
|
|
Date :
2011-10-03 10:04:36 |
By :
lootboom |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
โค้ดคับบบบบ
upload1
<body>
<form name="form1" method="post" action="upload2.php" enctype="multipart/form-data">
Name : <input type="text" name="txtName"><br>
Picture : <input type="file" name="filUpload"><br>
<input name="btnSubmit" type="submit" value="Submit">
</form>
</body>
</html>
........................................................................................................................
upload2
<?
if($_FILES["filUpload"]["name"] != "")
{
//*** Read file BINARY ***'
$fp = fopen($_FILES["filUpload"]["tmp_name"],"r");
$ReadBinary = fread($fp,filesize($_FILES["filUpload"]["tmp_name"]));
fclose($fp);
$FileData = addslashes($ReadBinary);
//*** Insert Record ***//
$objConnect = mysql_connect("localhost","root","") or die("Error Connect to Database");
$objDB = mysql_select_db("project");
$strSQL = "INSERT INTO files ";
$strSQL .="(Name,FilesName) VALUES ('".$_POST["txtName"]."','".$FileData."')";
$objQuery = mysql_query($strSQL);
echo "Copy/Upload Complete<br>";
mysql_close($objConnect);
}
?>
<a href="upload3.php">View files</a>
</body>
</html>
.......................................................................................................................................................................
upload3
<?
$objConnect = mysql_connect("localhost","root","") or die("Error Connect to Database");
$objDB = mysql_select_db("project");
$strSQL = "SELECT * FROM files";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<table width="340" border="1">
<tr>
<th width="50"> <div align="center">Files ID </div></th>
<th width="150"> <div align="center">Picture</div></th>
<th width="150"> <div align="center">Name</div></th>
<th width="150"> <div align="center">Edit</div></th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td><div align="center"><?=$objResult["FilesID"];?></div></td>
<td><center><img src="view.php?FilesID=<?=$objResult["FilesID"];?>"></center></td>
<td><center><?=$objResult["Name"];?></center></td>
<td><center><a href="upload4.php?FilesID=<?=$objResult["FilesID"];?>">Edit</a></center></td>
</tr>
<?
}
?>
</table>
<?
mysql_close($objConnect);
?>
</body>
</html>
............................................................................................................................
|
|
|
|
|
Date :
2011-10-03 16:07:04 |
By :
rainsad |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
view.php มันอยู่ตรงไหนของเมืองไทยครับท่าน
|
|
|
|
|
Date :
2011-10-03 16:11:09 |
By :
ikikkok |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
โค้ดคับ
upload1
<body>
<form name="form1" method="post" action="upload2.php" enctype="multipart/form-data">
Name : <input type="text" name="txtName"><br>
Picture : <input type="file" name="filUpload"><br>
<input name="btnSubmit" type="submit" value="Submit">
</form>
</body>
</html>
..................................................................................
upload2
<?
if($_FILES["filUpload"]["name"] != "")
{
//*** Read file BINARY ***'
$fp = fopen($_FILES["filUpload"]["tmp_name"],"r");
$ReadBinary = fread($fp,filesize($_FILES["filUpload"]["tmp_name"]));
fclose($fp);
$FileData = addslashes($ReadBinary);
//*** Insert Record ***//
$objConnect = mysql_connect("localhost","root","") or die("Error Connect to Database");
$objDB = mysql_select_db("project");
$strSQL = "INSERT INTO files ";
$strSQL .="(Name,FilesName) VALUES ('".$_POST["txtName"]."','".$FileData."')";
$objQuery = mysql_query($strSQL);
echo "Copy/Upload Complete<br>";
mysql_close($objConnect);
}
?>
<a href="upload3.php">View files</a>
</body>
</html>
.................................................................................................................
upload3
<?
$objConnect = mysql_connect("localhost","root","") or die("Error Connect to Database");
$objDB = mysql_select_db("project");
$strSQL = "SELECT * FROM files";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<table width="340" border="1">
<tr>
<th width="50"> <div align="center">Files ID </div></th>
<th width="150"> <div align="center">Picture</div></th>
<th width="150"> <div align="center">Name</div></th>
<th width="150"> <div align="center">Edit</div></th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td><div align="center"><?=$objResult["FilesID"];?></div></td>
<td><center><img src="view.php?FilesID=<?=$objResult["FilesID"];?>"></center></td>
<td><center><?=$objResult["Name"];?></center></td>
<td><center><a href="upload4.php?FilesID=<?=$objResult["FilesID"];?>">Edit</a></center></td>
</tr>
<?
}
?>
</table>
<?
mysql_close($objConnect);
?>
</body>
</html>
........................................................................................................................................
|
|
|
|
|
Date :
2011-10-03 16:13:27 |
By :
rainsad |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แต่คุณเขียน <td><center><img src="view.php?FilesID=<?=$objResult["FilesID"];?>"></center></td> แบบนี้นะ
|
|
|
|
|
Date :
2011-10-03 16:17:50 |
By :
ikikkok |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|