此处描述的处理程序处理来自GrabzIt屏幕快照Web服务的回调。 该处理程序的URL在以下位置传递给GrabzIt: callBackURL
的参数 Save 方法。
但是,只有在可以通过 Int以太网
以下参数作为GET参数传递给处理程序。
如果要阻止对处理程序的所有访问,除了GrabzIt之外,请使用此方法 安全技术.
这个例子展示了如何实现GrabzIt PHP处理程序。 这会捕获从GrabzIt服务传递给它的五个参数,包括传递给 GetResult 方法。
然后,此方法返回屏幕截图,即 saved在结果目录中。 但是如果 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);