note 73966 deleted from function.header by felipe
| From: | felipe@php.net | Date: | Sun, 30 Dec 2007 18:31:55 +0000 |
| Subject: | note 73966 deleted from function.header by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134382@lists.php.net to get a copy of this message | ||
Note Submitter: KKOOPORATION at gmail dot com
----
This is an Example of an UID based download Platform:
document 1:
<?php
if($_GET['verify']==broken){
die('Please do not leech.');
}
if($_GET['accepted']==1){
//Generate a password:
$password ="";
$pool .= "123456789";
srand ((double)microtime()*1000000);
for($index = 0; $index < 200; $index++)
{
$password .= substr($pool,(rand()%(strlen ($pool))), 1);
}
//use on a windows server:
passthru('echo '.$passwort.' >> verify.pajaxtxt');
//Use on a linux server:
//$fneu = fopen("verify.pajaxtxt","w+");
//fputs ($fneu,$password);
//fclose ($fneu);
header('location: document2.php?UID='.$password);
}
else
{
echo '<a href="?accepted=1">I accept (Insert what do you
think)</a>';
}
?>
document2:
<?php
//Check if $get exist:
if($_GET){
//Parameter for UID:
$s = $_GET['UID'];
//file definition:
$sa = file("verify.pajaxtxt");
for($i=0; $i<count($sa); $i++)
{
if (ereg($s, $sa[$i]))
{
//if verification code exist in the file:
echo "Finished!";
//end.
//
}
}
}
else
{
//Go back if the verification code does not exist in the file
header('location: document1.php?verify=broken');
//end.
}
?>
The file verify.pajaxtxt must deleted every day!