< >

keyholen.php


Quell Code


<html> 
<head> 
<title>Demo for License Key Class by Abhishek Shukla</title> 
</head> 
<body style="background-color:#F0F0F0"> 
<h1>License Key By Basti1012</h1> 
<h3>Gebe Name und Email an um deinen key zu erhalten</h3>

<form method="POST"> 
<table> 
<tr> 
 
<td>Dein Name</td> 
<td><input type="text" name="namen"></input></td> 
</tr> 
<tr> 
<td>Deine Email</td> 
<td><input type="text" name="mail"></input></td> 
</tr> 
</table> 
<input name="validate" type="submit"/> 
</table> 
</form> 
<?php 
  error_reporting(E_ALL); 
ini_set('display_errors', true);
if(isset($_POST['validate'])){ 
 
      $name=$_POST['namen'];  
        $mail=$_POST['mail'];
   /* 
 
for ($i = 0 ; $i < $totalChars ; $i++) {
    $currIndex = mt_rand(0, $countPool) ;
    $currChar = $pool[$currIndex] ;
    $serial .= $currChar ;
}

$break             =    "<br/>";
$eol            .= "\r\n";
$sol            .= "\n";
*/
    $errors = array(); 
 
    if (empty($_POST['namen'])) {
        $errors[] = 'Gebe dein Name / Pin / Passwort ein.';
    }
  
   if (!preg_match("/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)*\.([a-zA-Z]{2,6})$/", $_POST['mail'])) {
      $errors[] = 'Gebe eine Email Adresse ein.';
   }
 
 

    if (empty($errors)) { 
 

$file = 'keys.txt';
// $was = $mail.';'.$name.';'.date("r").';'.$serial.$eol;
 
 
 
// echo file_get_contents($file);


//while(isset($daten[$count1][0]))
  

//$speicherort = $_SERVER['DOCUMENT_ROOT']."/zaehler.csv"; //Speicherort der .csv Datei
$daten = array();  //Initialisieren Array
      if (file_exists($file)){
         $daten = file($file, FILE_IGNORE_NEW_LINES);  // liest die Daten zeilenweise in das Array $daten
         $count = 0;
         while(isset($daten[$count]))  {
            $daten[$count] = explode(";", $daten[$count]);  
            $count++;
           }
        }
        $mailfund='';
        $namefund='';
        $h=false;
//while(isset($daten[$count1][3])){
for($d=0;$d<=$count-1;$d++){
//echo ''.$daten[$d][3].'<br>';
if($daten[$d][0]==$mail){
//echo "Treffer email";
if($daten[$d][1]==$name){
$h=true;
$a1="Name und Email gefunden.<br>Deine Serialnummer ist<br>";
$a2=$daten[$d][3];
}else{
$mailfund="Name nicht gefunden";
}
}else{
$namefund="Email nicht gefunden";
}
}
 if($h==true){
 echo $a1.$a2;
 }else{
 echo $mailfund.$namefund;
 }
 



  } else { 
    
        echo '<strong>Error</strong><br/><br/>
        Bitte koregiere <br/>';
        foreach ($errors as $message) {  
            echo " - $message<br/>\n";
    }
        echo 'Please go <a href="javascript:history.go(-1)">back</a> and try again.</p>';
        
  }  
        
        

}
?> 
<br><br><a href="http://sebastian1012.bplaced.net">Back to Home Page</a> 
</body> 
</html>