Location: PHPKode > scripts > Proof Loaded Files > ProofLoadedFiles.example.php
<?php
/*******************************************
 * Author: Max Nowack                      *
 * Website: www.dasnov.de                  *
 * Classname: ProofLoadedFiles             *
 *******************************************
 * Description:                            *
 * The class proof which files are loaded  *
 * from the client. With this class your   *
 * can make forms or sites securer.        *
 * Example:                                *
 * The client must load all external files *
 * they liked in the script (stylesheets,  *
 * images, etc.). Otherwise the next site  *
 * will not open.                          *
 *******************************************/

require("ProofLoadedFiles.class.php"); //load the class

//create the class-object
//1. parameter: link to the file which open the images or stylesheets (path to image-file will be attached)
//2. parameter: directory of the images or stylesheets
$plf = new ProofLoadedFiles("ProofLoadedFiles.example.php?file=","");

if(isset($_GET['file']))
{
	//send the file to the browser
	header("Content-Type: ".$plf->getMimeType($_GET['file']));
	echo $plf->load($_GET['file']);
}
elseif(isset($_GET['proof']))
{
	//proof loaded files
	if($plf->proof())
	{
		echo "success";
	}
	else
	{
		echo "failed";
	}
}
elseif(isset($_GET['destroy']))
{
	//destroy the session (just for test)
	session_destroy();
	header("Location: ".$_SERVER['PHP_SELF']);
}
else
{
	//show the image and the link to the proof-script
	echo "<img src='".$plf->showLinkTo("test.png")."' /><br />";
	echo "<a href='".$_SERVER['PHP_SELF']."?proof'>Show Result</a>";
}
?>
Return current item: Proof Loaded Files