<? session_start(); if($_SESSION['id_member'] == "") { echo "Please Login!"; exit(); } $_SESSION['id_member']; echo "id_albulm= $list_album"; echo "id_member= $id_member"; mysql_connect("localhost","root","root"); mysql_select_db("project"); $strSQL = "SELECT * FROM member WHERE id_member = '".$_SESSION['id_member']."' "; $objQuery = mysql_query($strSQL); $objResult = mysql_fetch_array($objQuery); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> #ttt { text-align: right; } </style> </head> <script language="javascript"> function CreateNewRow() { var intLine = parseInt(document.frmMain.hdnMaxLine.value); intLine++; var theTable = document.getElementById("tbExp"); var newRow = theTable.insertRow(theTable.rows.length) newRow.id = newRow.uniqueID var newCell //*** Column 1 ***// newCell = newRow.insertCell(0); newCell.id = newCell.uniqueID; newCell.setAttribute("className", "css-name"); newCell.innerHTML = "<center><INPUT TYPE=\"file\" SIZE=\"5\" NAME=\"filUpload"+intLine+"\" ID=\"filUpload"+intLine+"\" VALUE=\"\"></center>"; document.frmMain.hdnMaxLine.value = intLine; } function RemoveRow() { intLine = parseInt(document.frmMain.hdnMaxLine.value); if(parseInt(intLine) > 0) { theTable = document.getElementById("tbExp"); theTableBody = theTable.tBodies[0]; theTableBody.deleteRow(intLine); intLine--; document.frmMain.hdnMaxLine.value = intLine; } } </script> <body> <form name="frmMain" method="post" action="add_image.php"> <table width="445" border="0" id="tbExp"> <tr> <td><div align="center">เลือกไฟล์ <input name="btnAdd" type="button" id="btnAdd" value="เพิ่ม +" onClick="CreateNewRow();"> <input name="btnDel" type="button" id="btnDel" value="ลบ -" onClick="RemoveRow();"> </div></td> </tr> </table> <p> <input type="hidden" name="hdnMaxLine" value="0"> <input name="input" type="submit" value="ยืนยัน" > </p> </form> </body> </html>
<? session_start(); if($_SESSION['id_member'] == "") { echo "Please Login!"; exit(); } $_SESSION['id_member']; $_POST['list_album']; echo "id_albulm= $list_album"; echo "id_member= $id_member"; mysql_connect("localhost","root","root"); mysql_select_db("project"); $strSQL = "SELECT * FROM member WHERE id_member = '".$_SESSION['id_member']."' "; $objQuery = mysql_query($strSQL); $objResult = mysql_fetch_array($objQuery); ?> <html> <head> <title></title> </head> <body> <? $id=$_GET[id]; $loginid=$_POST[loginid]; $fileupload=$_FILES['fileupload']['tmp_name']; $fileupload_name=$_FILES['fileupload']['name']; $objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database"); $objDB = mysql_select_db("project"); for($i=0;$i<count($_FILES["filUpload"]["name_photo"]);$i++) { if($_FILES["filUpload"]["name_photo"][$i] != "") { if(move_uploaded_file($_FILES["filUpload"]["tmp_name"][$i],"myfile/".$_FILES["filUpload"]["name_photo"][$i])) { //*** Insert Record ***// $strSQL = "INSERT INTO photo"; $strSQL .="(name_photo) VALUES ('".$_FILES["filUpload"]["name_photo"][$i]."')"; $objQuery = mysql_query($strSQL); } } } echo "Copy/Upload Complete<br>"; ?> <a href="PageMultiUploadToMySQL3.php">View files</a> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง