PHP Classes

File: handler.php

Recommend this page to a friend!
  Classes of GrabzIt  >  GrabzIt PHP Library  >  handler.php  >  Download  
File: handler.php
Role: Example script
Content type: text/plain
Description: An example of a GrabzIt handler
Class: GrabzIt PHP Library
Take screenshots of Web pages using GrabzIt
Author: By
Last change: Version 3
Date: 5 years ago
Size: 695 bytes


Class file image Download

//This PHP file handles the GrabzIt callback

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

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

$grabzIt = new GrabzItClient($grabzItApplicationKey, $grabzItApplicationSecret);
$result = $grabzIt->GetResult($id);

if (!

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

For more information send a message to info at phpclasses dot org.