PHP Classes

File: hash_check.php

Recommend this page to a friend!
  Classes of Julien PACHET   Hash   hash_check.php   Download  
File: hash_check.php
Role: Example script
Content type: text/plain
Description: Second page to check the hash and let access to the ressource
Class: Hash
Store and validate hashes for data authentication
Author: By
Last change:
Date: 20 years ago
Size: 769 bytes
 

Contents

Class file image Download
<?

require_once("class_hash.inc.php");
require_once(
"biblio_www.inc.php");

$hash=www_get_param("hash","");
$item=www_get_param("item","");

// private data not to be known. Can be login / password for example. The same
$data_server="a private data from the server";
$data_site="a private string of the site";

echo
"Here is the hash created: $hash<br>\n";
echo
"Item to be verified: $item<br>\n";
echo
"<br>\n";

$h=new hash($data_server,$data_site,5);

$res=$h->check_hash($hash,$item);
if (
$res)
  echo
"<font color=#0000FF>Check ok!</a><br>\n";
else
  echo
"<font color=#FF0000>Check not ok!<br></a>\n";
echo
"<br>\n";
echo
"<a href=hash_check.php?hash=$hash&item=$item>Refresh</a><br>\n";
echo
"<a href=hash_start.php>back</a><br>\n";
?>