$config['id']=1; // Lietotaja ID (var atrast Solar-F Statistika - http://stats.solarf.lv )
$config['prices']=array(1=>'15','25','35','50','60','75','95','150','200','250','300'); // Te lugums neko nemainit!
function check_valid_code($code){
global $config;
foreach($config['prices'] as $i => $val){
$result = join('', file("http://sms.solarf.lv/confirm.php?id=".$config[id]."&price=".$val."&code=$code"));
if($result=='key_ok'){
return $val;
}
}
}
if($_POST){
$code=mysql_escape_string($_POST['code']);
$valid=check_valid_code($code);
if($valid){
print("Paldies! Price: ".$valid); // kods derigs , atgriez price
}
else {
print("Nepareizs kods"); // nepareiz kods
}
}
print("<form action='' method='post'>");
print("<input type='text' size='6' maxlength='8' name='code' value=''>");
print("<input type='submit' name='check_code' value='Buy'>");
print("</form>");
kur var cenu noradit cik maksa viens fails ?