$host = 'localhost'; $database = '707402_wp9'; $user = '707402_wp9'; $password = 'vr95WVe2dSf'; if (isset($_POST['img'])) { $img = $_POST['img']; $file = 'holsts/img'.date("YmdHis").'.svg'; if (file_put_contents($file, $img)) { $link = mysqli_connect($host, $user, $password, $database); $query ="SELECT * FROM phones"; $result = mysqli_query($link, "INSERT INTO k_images_holsts (name, url_img) VALUES ('".$_POST['name']."', '".$file."')"); echo 1; die(); } else { die(); } } ?> $url = ((!empty($_SERVER['HTTPS'])) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $url = explode('?', $url); $url = $url[0]; ?> if (isset($_GET['sketch_img'])) { list($width, $height, $type, $attr) = getimagesize($_GET['sketch_img']); ?>