<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Add Product</title> </head> <body> <center> <form name='addhistory' method='post' action='added_listhistory.php' enctype="multipart/form-data"> <table border='1'> <tr> <td><center><h2>เพิ่มรายการยุคสมัยประวัติศาสตร์ใหม่</h2></center></td> </tr> <tr> <td> <table> <tr> <td><label>ชื่อยุคสมัย : <td> <td><input type='text' name='name'></label><br></td> </tr> <tr> <td><label>เนื้อหาประวัติศาสตร์ : <td> <td><textarea name="detail"></textarea> <!-- <td><input type='textarea' name='discription'></label><br></td> --> </tr> <tr> <td><label>รูปภาพประกอบ : <td> <td><input type='file' name='piture'></label><br></td> </tr> </td> <tr align='center'> <td> <br> <input type='submit' name='submit' value='เพิ่มข้อมูล'> <input type='reset' name='reset' value='ยกเลิก'> </td> </tr> <br> </table> <br> </table> </form> </center> </body> </html>
<? $fileName = date("YmdHis")."_".$_FILES["picture"]["name"]; if(move_uploaded_file($_FILES["picture"]["tmp_name"],"filepichistory/".$fileName)) { //*** Insert Record ***// include_once "connect099.inc.php"; $strSQL = "INSERT INTO historygen "; $strSQL .="(history_name,history_detail,history_picture) VALUES ('".$_GET["history_id"]."','".$_POST["name"]."','".$_POST["detail"]."','".$fileName."')"; $objQuery = mysql_query($strSQL); mysql_close($objConnect); echo "Copy/Upload Complete<br>"; } ?> <a href="list_historygen.php?history_id=<?=$_GET["history_id"];?>">View</a> </body> </html>
<?php session_start(); ob_start(); include_once "connect099.inc.php"; $rid=$_REQUEST['id']; $sql="SELECT * FROM historygen WHERE history_id like '$rid'"; mysql_query('SET NAMES utf8'); $qsql=mysql_query($sql); $row=mysql_fetch_array($qsql); ?> <body bgcolor="#FFFF00"> <form action="edited_history.php" method="post" > <table width="714" height="467" border="1"> <tr> <td width="183">ชื่อยุคสมัย</td> <td width="515"><input name="name" type="text" id="name" value="<?php echo $row["history_name"]; ?>" /></td> </tr> <tr> <td height="91">เนื้อหาประวัติศาสตร์</td> <td> <textarea name="detail" id="detail" cols="45" rows="5" ><?php echo $row["history_detail"]; ?></textarea> </td> </tr> <tr> <td valign="top" >รูปภาพ</td> <td><label for="picture"></label> <img src="picture/<?=$row["history_picture"];?>"><br> Picture : <input type="file" name="filUpload"><br> <input type="hidden" name="hdnOldFile" value="<?=$row["history_picture"];?>"></td></tr> </td> </tr> <tr> <td>คลิปวีดีโอ</td> <td><label for="video"></label> <video src="clip/<?=$row["history_clip"];?>"><br> Clip : <input type="file" name="filUpload"><br> <input type="hidden" name="hdnOldFile" value="<?=$row["history_clip"];?>"> </td> </tr> <tr> <td>ไฟล์เอกสารความรู้</td> <td><label for="doc"></label> <video src="clip/<?=$row["history_doc"];?>"><br> Clip : <input type="file" name="filUpload"><br> <input type="hidden" name="hdnOldFile" value="<?=$row["history_doc"];?>"> </td> </tr> <input name="id" type="hidden" id="id" value="<?php echo $row["history_id"]; ?>" /> <tr> <td colspan="2" align="center"> <input name="submit" type="submit" id="submit" value="Submit" /> <input name="reset" type="reset" id="reset" value="Reset" /> </td> </tr> </table> </body> </html> <html> <head> <title></title> </head> <body>
<?php $history_name = $_POST['name']; $history_detail = $_POST['detail']; $history_picture = $_POST['picture']; include_once('connect099.inc.php'); mysql_query('SET NAMES utf8'); $sql_update="UPDATE historygen SET history_name='$name',history_detail='$detail',history_picture='$picture' WHERE history_id='$id'"; $result = mysql_query($sql_update); if($result) { header("refresh:3;historygen_detail.php"); echo "Edited Success"; }else{ echo "Edit Failed!"; } //mysql_close(); ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง