Server IP : 119.59.102.212 / Your IP : 3.141.244.88 Web Server : Apache/2 System : Linux narin 2.6.32-042stab142.1 #1 SMP Tue Jan 28 23:44:17 MSK 2020 x86_64 User : yangkam ( 1022) PHP Version : 5.6.40 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/yangkam/domains/yangkam.go.th/public_html/coremain/module/link/ |
Upload File : |
<?php $navig['load']=$data_name_menu_sub['name']; $navig['adddownload_form']="เพิ่มข้อมูล"; navigator($navig); bar_header($_SESSION['bar_name']); // Bar_Header fieldset_top($_SESSION['bar_name']); import_request_variables('pG', 'p_'); if($p_add!="") { $add=trim($p_add); } if($p_topic!="") { $topic=trim($p_topic); } if($p_download_url!="") { $download_url=trim($p_download_url); } if($p_id_group!="") { $id_group=trim($p_id_group); } $userfile1_name=trim($_FILES['userfile1']['name']); $sql="ALTER TABLE `cms_file` CHANGE `id` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT"; mysql_query($sql); // add topic download if ($add == "1" && $topic != "") { if ($userfile1_name != "") { //$strings1 = substr($userfile1_name, -4); $strings1 = get_file_type($userfile1_name); if ($strings1 == ".php" or $strings1 == ".asp") { echo"<center><br>ไฟล์ประกอบไม่อนุญาตให้ Upload <br>เนื่องจากชนิดไฟล์เสียงต่อความเสียหายของระบบ<br><br>"; echo"<a href='javascript:history.back()'><font color='ff0000'>[แก้ไขใหม่]</font></center></a>"; // include('coremain/footer.php'); exit; } } //********************** ตรวจสอบว่า มีการ Upload File ที่ 1 หรือไม*******************************************่ if ($userfile1_name != "") { // กำหนดชื่อไฟล์ที่ upload ใหม่ ทั้งนี้เพื่อให้ ไฟล์ไม่ซ้ำกัน $sqlmax1 = "select max(id+1) from cms_file"; $resultmax1 = mysql_query($sqlmax1); $datamax1 = mysql_fetch_row($resultmax1); // ชื่อไฟล์ $strings = substr($userfile1_name, -4); $strings1 = get_file_type($userfile1_name); $name1 = "uploadsfiles$datamax1[0]$strings"; $dlink = "$_SESSION[web_name]/mainfile/" . $name1; $temp_name = $_FILES['userfile1']['tmp_name']; if (is_uploaded_file($_FILES['userfile1']['tmp_name'])) { if (!move_uploaded_file($temp_name, $dlink)) { } } } $sql = "INSERT INTO cms_file(id,id_sub,topic,files,status) values('','$_SESSION[id_sub]','$topic','$name1','1')"; $result = mysql_query($sql) or die(mysql_error()); echo"<br><br><center>ข้อมูลได้ถูกเพิ่มแล้ว<br><br></enter>"; echo "<meta http-equiv='refresh' content='1; url=index.php?mod=load&path=load'>"; // include('coremain/footer.php'); exit; } ?> <br> <table width="500" border="0" align="center" cellpadding="1" cellspacing="3"> <form name="add" enctype="multipart/form-data" action="index.php?mod=adddownload_form&add=1&id_group=<?echo $id_group?>&path=load" method="post" onSubmit="return checkadd()"> <tr height="30"> <td width=5%></td> <td width=25%><div align="left"><img src='coremain/images/marker.gif'> <b>ชื่อไฟล์</b></div></td> <td width=65%><div align="left"><input name="topic" type="text" size="40"></td> </tr> <tr> <td width=5%></td> <td width=25%><div align="left"><img src='coremain/images/marker.gif'> <b>Upload File</b></div></td> <td width=65%><div align="left"><input name="userfile1" type="file" size="40"> <img src='coremain/images/bu.gif' border='0' title='ต้องเป็นไฟล์ที่ไม่ใช่ .php หรือ .asp หรือ .exe' onmouseover=this.style.cursor='hand'></td> </tr> <?php button_text('เพิ่มข้อมูล', 'Submit', 3, '', 'กรุณาเลือกไฟล์ที่จะ Upload'); ?> <!-- <tr height="45"> <td width=5%></td> <td width=15%></td> <td width=80%><div align="left"> <input type="submit" name="Submit" value="เพิ่มข้อมูล" onmouseover="this.style.cursor='hand'"> </td> </tr>--> </form> </table> <?php fieldset_down();?> <script language="javascript"> function checkadd() { if(document.add.topic.value=="") { alert("กรุณากรอกเนื้อหาดาวน์โหลด !") ; document.add.topic.focus() ; return false ; } else if(document.add.userfile1.value=="") { alert("กรุณาเลือกไฟล์ที่จะ Upload !") ; document.add.userfile1.focus() ; return false ; } else return true ; } </script>