?

áEÓê¤ÎïLwebshll2019

Current Path : /home/webyoo/www/backup/allback/test_become/
Upload File :
Current File : /home/webyoo/www/backup/allback/test_become/db.php

<?php
class Db {
	private $db;
	function __construct() {
		self::getDbCon();
	}
	function getDbCon() {
		try {
			$db = new PDO("mysql:host=194.213.4.152;dbname=become_michael;charset=utf8", "michael_user", "become_michael_2019");
			$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
			$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
			$this->db = $db;
		}
		catch(PDOException $e) {
			echo "db connection error.";
			die();
		}
	}
	public function getUsers(){
		$curl = curl_init();
		curl_setopt_array($curl, [
			CURLOPT_RETURNTRANSFER => 1,
			CURLOPT_URL => 'http://become.weblife.co.il/api/users.php?key=become&password=become-2019'
		]);
		return $resp = curl_exec($curl);
		curl_close($curl);
	}
	public function insertUsers($obj){
		foreach($obj["users"] as $item) {
			echo $item["first_name"];
			$data = [
				'first_name' => $item["first_name"],
				'last_name' => $item["last_name"],
				'email' => $item["email"],
				'birth_date' => $item["birth_date"],
				'phone' => $item["phone"],
				'city_id' => $item["city_id"],
			];
			//$sql = "INSERT INTO users (first_name, last_name, email, birth_date, phone, city_id) VALUES (?,?,?,?,?,?)";
			$sql = "INSERT INTO users (first_name, last_name, email, birth_date, phone, city_id) VALUES ('sdfds','sdffds','fhfh','2019-10-20','jkljkl','1')";
			$db->prepare($sql)->execute($data);
		}
	}
}
?>



web shell, Coded By 2019