웹 캡처 및 변환 도구

PHP 처리기

PHP API

상품 설명

핸들러를 디버깅하는 데 문제가 있습니까? 시도 콜백 핸들러 테스트 도구.

여기에 설명 된 핸들러는 GrabzIt 스크린 샷 웹 서비스에서 콜백을 처리합니다. 이 핸들러의 URL은 GrabzIt에 전달됩니다. callBackURL 의 매개 변수 Save 방법. 그러나이 기술은 핸들러를 통해 액세스 할 수있는 경우에만 작동합니다. Internet.

다음 매개 변수는 GET 매개 변수로 핸들러에 전달됩니다.

GrabzIt을 제외하고 핸들러에 대한 모든 액세스를 차단하려면 이것을 사용하십시오. 보안 기술.

애플리케이션이 localhost에있는 경우이 콜백이 작동하지 않습니다.

이 예에서는 GrabzIt PHP 핸들러를 구현하는 방법을 보여줍니다. 이는 GrabzIt 서비스에서 전달된 6개의 매개변수를 캡처합니다. 여기에는 스크린샷의 고유 ID가 포함됩니다. GetResult 방법.

그런 다음이 메소드는 스크린 샷을 반환합니다. save결과 디렉토리에 d. 그러나 null 에서 값이 반환됩니다 GetResult 이 방법은 오류가 발생했음을 나타냅니다.

include("GrabzItClient.php");

// This PHP file handles the GrabzIt callback

$message = $_GET["message"];
$customId = $_GET["customid"];
$id = $_GET["id"];
$filename = $_GET["filename"];
$format = $_GET["format"];
$targetError = $_GET["targeterror"];

// Custom id can be used to store user ids or whatever is needed for the later processing of the
// resulting screenshot

$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret")%>");
$result = $grabzIt->GetResult($id);

if (!$result)
{
   return;
}

// Ensure that the application has the correct rights for this directory.
file_put_contents("results" . DIRECTORY_SEPARATOR . $filename, $result);