1. Go to this page and download the library: Download thscz/query-signer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
interface ExpirationStoreInterface {
/**
* @param $hash string created by QuerySigner
* @param $timestamp integer UNIX timestamp value when hash expires
* @throws ExpirationStoreException
*/
public function set(string $hash, int $timestamp): void;
/**
* @return integer|null UNIX timestamp value when hash expires
* @throws ExpirationStoreException
*/
public function get(string $hash): ?int;
/**
* Deletes expiration information for hash
* @param $hash string created by QuerySigner
* @throws ExpirationStoreException
*/
public function revoke(string $hash): void;
}
// ...
// <a href="/order/45623">Order detail</a>
$querySigner = new \THSCZ\QuerySigner\QuerySigner('supersecrtet', new \THSCZ\QuerySigner\Store\FileExpirationStore(__DIR__ . '/var/signs'));
// hash is now valid for current UNIX timestamp + 60 seconds
$hash = $querySigner->sign([45623], 60);
echo '<a href="/order/45623/&hash='. $hash .'">Order detail</a>';
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.