PHP Classes

File: secure_get.php

Recommend this page to a friend!
  Classes of Gianluca Zanferrari   Secure Get   secure_get.php   Download  
File: secure_get.php
Role: Example script
Content type: text/plain
Description: example
Class: Secure Get
Generate and validate URLs to prevent tampering
Author: By
Last change:
Date: 12 years ago
Size: 647 bytes
 

Contents

Class file image Download
<?php
require_once('secure_get.class.php');

$arrValues = array('city'=>'Amsterdam', 'name'=>'J. Rambo', 'age'=>'45');

$sg = new secure_get;

$link = $sg->secure_make($arrValues);
?>
<h2>1. Click on the link here below to perform the 1st test.</h2>
<h2>2. Then, manipulate the URL query string and resubmit the page (not clicking obviously on the link) to perform the 2nd test.</h2>
<a href="<?=$link?>">Click here to see the result</a>
<p>
<?php
/*
 * checks if the data is sent properly
 */
if(isset($_GET['sha1'])):
   
   echo(
$sg->secure_check($_GET)) ? 'SENT PROPERLY' : 'SENT WITH MANUPULATION';
   
endif;
?>
</p>