|
|
|
[PHP][มือใหม่][slidershow] ช่วยดูให้ทีครับผมทำภาพ silder ละภาพมันใหญ่เกินจะกำหนดยังไงครับ |
|
|
|
|
|
|
|
ผลลัพธ์เป็นแบบนี้ครับ
เรียกภาพมาแสดงเป็น slider
Code (PHP)
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/coin-slider.min.js"></script>
<link rel="stylesheet" href="css/coin-slider-styles.css" type="text/css" />
<script type="text/javascript">
$(document).ready(function() {
$('#gamesHolder').coinslider();
});
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#coin-slider').coinslider({ width: 900, navigation: false, delay: 5000 });
});
</script>
</head>
<body>
<?php
$objConnect = mysql_connect("localhost","root","") or die("Error Connect to Database");
$objDB = mysql_select_db("dormitory");
$DormitoryID = $_REQUEST['show'];
$strSQL2 = "SELECT * FROM gallery WHERE DormitoryID = '$DormitoryID' ";
$objQuery2 = mysql_query($strSQL2) or die ("Error Query [".$strSQL2."]");
echo"<table border=\"1\" cellspacing=\"1\" cellpadding=\"1\"><tr>";
$intRows = 0;
while($objResult2 = mysql_fetch_array($objQuery2))
{
echo "<td>";
$intRows++;
?>
<div id="gamesHolder">
<div id="games">
<a href="images/<?php echo $objResult2["Picture1"];?>" <?php echo $objResult2["Galleryname"];?>"><img src="images/<?php echo $objResult2["Picture1"];?>" width="150" height="150"></a><br>
<br>
</center>
<?php
echo"</td>";
if(($intRows)%4==0)
{
echo"</tr>";
}
}
echo"</tr></table>";
mysql_close($objConnect);
?>
</body>
</html>
อันนี้ตอน upload ภาพ
Code (PHP)
<?php
mysql_connect("localhost","root","");
mysql_select_db("dormitory");
mysql_query("SET NAMES UTF8");
$addpicID = $_POST["addpicID"];
for($i=1;$i<=(int)($_POST["hdnLine"]);$i++)
{
if($_FILES["fileUpload".$i]["name"] != "")
{
if(copy($_FILES["fileUpload".$i]["tmp_name"],"images/".$_FILES["fileUpload".$i]["name"]))
{
$strSQL = "INSERT INTO gallery ";
$strSQL .="(GalleryID,Galleryname,Picture1,dormitoryID) VALUES (NULL,'".$_POST["txtGalleryName".$i]."','".$_FILES["fileUpload".$i]["name"]."','$addpicID')";
$objQuery = mysql_query($strSQL)or die(mysql_error());
echo "Copy/Upload ".$_FILES["fileUpload".$i]["name"]." completed.<br>";
}
}
}
echo "<br><a href='php_multiple_upload6.php'>View file</a>";
mysql_close();
?>
Tag : PHP, jQuery
|
|
|
|
|
|
Date :
2016-06-15 18:12:33 |
By :
mylastgame |
View :
721 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|