Server IP : 202.29.229.35 / Your IP : 3.137.161.250 Web Server : Apache System : Linux aapanel2 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 User : www ( 1001) PHP Version : 5.5.38 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/www.ivecr2.ac.th/stdcard/connect/systemDb/ |
Upload File : |
<?php //ฟังก์ชันตรวจสอบสกุลและคำนวณขนาดไฟล์ โดยจะต้องกำหนดชื่อไฟล์ที่อัพโหลดจากฟอร์มและเงื่อนไขสกุลไฟล์ที่ต้องการ function checkFileExtension($file_name, $extCondition){ $ext = strtolower(end(explode('.', $file_name))); if ($extCondition) {return true;}else { return false;} } //ฟังก์ชันตรวจสอบขนาดตามที่กำหนด function checkFileSize($sizeOfFile, $sizeLimit){ $photo_size /= 1024; if ($sizeOfFile>$sizeLimit){ echo "ขนาดไฟล์เกินกว่ากำหนด.."; exit(); } } // ฟังก์ชันแปลงวันเดือนปี function displaydate($x){ $thai_m=array("มกราคม", "กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"); $date_array=explode("-",$x); $y=$date_array[0]; $m=$date_array[1]-1; $d=$date_array[2]; $m=$thai_m[$m]; $y=$y+543; $displaydate="$d $m $y"; return $displaydate; } function displaydaythai($date){ //$date1 = "02-13-2012"; $parts1 = explode("-", $date); $date2 = $parts1[1]."-".$parts1[2]."-".$parts1[0]; $parts = explode("-", $date2); $timestamp = mktime(0,0,0,$parts[0],$parts[1],$parts[2]); setlocale(LC_TIME, "tha"); //echo strftime("%A", $timestamp ); return iconv("tis-620","utf-8",strftime("%A", $timestamp )); } //ฟังก์ชันตรวจสอบเมล์ function checkemail($checkemail){ if (ereg( "^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-]" ,$checkemail)) { return true; }else{ return false; } } //ฟังก์ชันตรวจสอบคำหยาบ function checkrude($m_ment){ $filename='../../config/rude.txt'; $fp=fopen($filename,'r'); $data=fread($fp,filesize($filename)); fclose($fp); //$rudeword=explode("\n",trim($data)); $rudeword=explode(",",trim($data)); $replace='<font color="RED">***</font>'; for($i=0;$i<count($rudeword);$i++){ $m_ment=str_replace(trim($rudeword[$i]),$replace,$m_ment); } return $m_ment; } function checkGroupStd($groub_id){ $year = "25".substr($groub_id , 0, 2); $level = substr($groub_id , 2, 1); $groub = substr($groub_id , 7, 2); if ($level ==3){$level="ปวส.";}else{$level="ปวช.";} $today = getdate(); $yy = $today[year] +543; $n = $yy - $year ; //echo $n; $class = $level." ".$n." กลุ่ม ".$groub; return $class; } function checknummeric($num){ if(ereg("[0-9]",$num)){ return true; }else{ return false; } } function checkstring($txt){ if(ereg("[0-9]",$txt)){ return true; }else{ return false; } } function checkspace($txt){ if(ereg("\s",$txt)){ return true; }else{ return false; } } ?>