|
|
|
เรื่่องระบบอัพโหลดครับ ไฟล์มันไม่เข้าไปใน DB มึนฮะ |
|
|
|
|
|
|
|
Code (PHP)
<?
session_start();
if($_SESSION['UserID'] == "")
{
echo "Please Login!";
exit();
}
if($_SESSION['Status'] != "USER")
{
echo "This page for User only!";
exit();
}
mysql_connect("localhost","root","1234");
mysql_select_db("projectblack");
$strSQL = "SELECT * FROM signup WHERE UserID = '".$_SESSION['UserID']."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body {
background-color: #000000;
background-image: url(images/bd_bg1px.jpg);
}
body,td,th {
color: #FFFFFF;
}
.style1 {
color: #009966;
font-weight: bold;
}
-->
</style></head>
<body>
<div align="center">
<p align="left"><img src="images/logo.jpg" width="255" height="36"></p>
<p> </p>
<p align="left"><strong><a href="user_page.php"><img src="images/tp_activbg1.jpg" width="104" height="32" border="0"></a><a href="upload.php"><img src="images/tp_upload.jpg" alt="" width="104" height="32" border="0"></a></strong><a href="allfiles.php"><img src="images/55555.jpg" alt="" width="104" height="32" border="0"></a><a href="logout.php"><img src="images/tp_logout.jpg" width="104" height="32" border="0"></a></p>
<p> </p>
<p> </p>
<p><span class="style1">Welcome to Page Upload!</span></p>
<form name="form1" method="post" action="save_upload.php" enctype="multipart/form-data">
<div align="left">Name :
<input type="text" name="txtName">
<br>
VDO Clip :
<input type="file" name="filUpload">
<br>
<input name="btnSubmit" type="submit" value="Submit">
</div>
</form>
<p><br>
</p>
<p><br>
<br>
</p>
<p><br>
<img src="images/lp_shadebg.jpg" width="1083" height="119"></p>
</div>
</body>
</html>
Code (PHP)
<?
session_start();
if($_SESSION['UserID'] == "")
{
echo "Please Login!";
print "<meta http-equiv=refresh content=2;URL=login1.php>";
exit();
}
if($_SESSION['Status'] != "USER")
{
echo "This page for User only!";
exit();
}
mysql_connect("localhost","root","1234");
mysql_select_db("projectblack");
$strSQL = "SELECT * FROM signup WHERE UserID = '".$_SESSION['UserID']."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
?>
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body {
background-color: #333333;
}
-->
</style></head>
<body>
<div align="center">
<?
if(move_uploaded_file($_FILES["filUpload"]["tmp_name"],"vdo/".$_FILES["filUpload"]["name"]))
{
echo "Copy/Upload Complete<br>";
//*** Insert Record ***//
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("projectblack");
$strSQL = "INSERT INTO files ";
$strSQL .="(Name,FilesName,Size,ContentType) VALUES ('".$_POST["txtName"]."' ,'".$_FILES["filUpload"]["name"]."' ,'".$_FILES["filUpload"]["size"]."' ,'".$_FILES["filUpload"]["type"]."')";
$objQuery = mysql_query($strSQL);
mysql_close($objConnect);
}
?>
<a href="allfiles.php">View files</a></div>
</body>
</html>
Code (PHP)
<?
session_start();
if($_SESSION['UserID'] == "")
{
echo "Please Login!";
exit();
}
if($_SESSION['Status'] != "USER")
{
echo "This page for User only!";
exit();
}
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("projectblack");
$strSQL = "SELECT * FROM signup WHERE UserID = '".$_SESSION['UserID']."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body {
background-color: #000000;
background-image: url(images/bd_bg1px.jpg);
}
body,td,th {
color: #FFFFFF;
}
.style1 {
color: #009966;
font-weight: bold;
}
-->
</style></head>
<body>
<div align="center">
<p align="left"><img src="images/logo.jpg" width="255" height="36"></p>
<p> </p>
<p align="left"><strong><a href="user_page.php"><img src="images/tp_activbg1.jpg" width="104" height="32" border="0"></a></strong><a href="upload.php"><img src="images/tp_upload.jpg" alt="" width="104" height="32" border="0"></a><a href="allfiles.php"><img src="images/55555.jpg" alt="" width="104" height="32" border="0"></a><a href="logout.php"><img src="images/tp_logout.jpg" width="104" height="32" border="0"></a></p>
<p> </p>
<p> </p>
<p><span class="style1">Welcome</span></p>
<form name="form1" method="post" action="">
<?
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("projectblack");
$strSQL = "SELECT * FROM files";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<table width="450" border="1">
<tr>
<th width="50"> <div align="center">Files ID </div></th>
<th width="150"> <div align="center">Name</div></th>
<th width="100"> <div align="center">Edit</div></th>
<th width="100"> <div align="center">View/Player</div></th>
<th width="100"> <div align="center">Delete</div></th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td><div align="center"><?=$objResult["FilesID"];?></div></td>
<td><center><?=$objResult["Name"];?></center></td>
<td><center><a href="edit.php?FilesID=<?=$objResult["FilesID"];?>">Edit</a></center></td>
<td><center><a href="view.php?FilesID=<?=$objResult["FilesID"];?>">View</a></center></td>
<td><center><a href="delete.php?FilesID=<?=$objResult["FilesID"];?>">Delete</a></center></td>
</tr>
<?
}
?>
</table>
<br>
<?
mysql_close($objConnect);
?>
</form>
<p><br>
</p>
<p><br>
<br>
</p>
<p><br>
<img src="images/lp_shadebg.jpg" width="1083" height="119"></p>
</div>
</body>
</html>
อันแรก อัพโหลด อันสอง เซฟอัพโหลดครับ อันสาม ไฟล์ทั้งหมดครับ
Tag : PHP
|
|
|
|
|
|
Date :
2012-02-13 18:49:02 |
By :
dfhpedpl |
View :
977 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
อันนี้เป็น allfile ครับ
Code (PHP)
<?
session_start();
if($_SESSION['UserID'] == "")
{
echo "Please Login!";
exit();
}
if($_SESSION['Status'] != "USER")
{
echo "This page for User only!";
exit();
}
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("projectblack");
$strSQL = "SELECT * FROM signup WHERE UserID = '".$_SESSION['UserID']."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
?>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body {
background-color: #000000;
background-image: url(images/bd_bg1px.jpg);
}
body,td,th {
color: #FFFFFF;
}
.style1 {
color: #009966;
font-weight: bold;
}
-->
</style></head>
<body>
<div align="center">
<p align="left"><img src="images/logo.jpg" width="255" height="36"></p>
<p> </p>
<p align="left"><strong><a href="user_page.php"><img src="images/tp_activbg1.jpg" width="104" height="32" border="0"></a></strong><a href="upload.php"><img src="images/tp_upload.jpg" alt="" width="104" height="32" border="0"></a><a href="allfiles.php"><img src="images/55555.jpg" alt="" width="104" height="32" border="0"></a><a href="logout.php"><img src="images/tp_logout.jpg" width="104" height="32" border="0"></a></p>
<p> </p>
<p> </p>
<p><span class="style1">Welcome</span></p>
<form name="form1" method="post" action="">
<?
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("projectblack");
$strSQL = "SELECT * FROM files";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<table width="450" border="1">
<tr>
<th width="50"> <div align="center">Files ID </div></th>
<th width="150"> <div align="center">Name</div></th>
<th width="100"> <div align="center">Edit</div></th>
<th width="100"> <div align="center">View/Player</div></th>
<th width="100"> <div align="center">Delete</div></th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td><div align="center"><?=$objResult["FilesID"];?></div></td>
<td><center><?=$objResult["Name"];?></center></td>
<td><center><a href="edit.php?FilesID=<?=$objResult["FilesID"];?>">Edit</a></center></td>
<td><center><a href="view.php?FilesID=<?=$objResult["FilesID"];?>">View</a></center></td>
<td><center><a href="delete.php?FilesID=<?=$objResult["FilesID"];?>">Delete</a></center></td>
</tr>
<?
}
?>
</table>
<br>
<?
mysql_close($objConnect);
?>
</form>
<p><br>
</p>
<p><br>
<br>
</p>
<p><br>
<img src="images/lp_shadebg.jpg" width="1083" height="119"></p>
</div>
</body>
</html>
|
|
|
|
|
Date :
2012-02-13 21:29:24 |
By :
bird |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
มันอัพไฟล์ อื่นๆไม่ได้นอกจากที่ให้มากับโค้ดครับ
|
|
|
|
|
Date :
2012-02-14 16:55:48 |
By :
5555 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ยังไม่มีใครมาช่วยเลยครับบบบบ
|
|
|
|
|
Date :
2012-02-14 17:01:29 |
By :
birdkak |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|