Dostalem taki kod:
<?php
$id = 1234; # numer ID zarejestrowanego klienta
$code = "IDENT"; # identyfikator us3ug SMS
$type = "sms"; # typ konta: sms - 8 znakowy kod bezobs3ugowy
$page = "main.php"; # strona po poprawnej zap3acie
$del = 0; # jezeli kod ma byc jednorazowy to ustaw wartosc 1
# ---------------------------------------------------------------------------------
$check = $_POST['check']; # podany kod na stronie gdzie wejście jest p3atne i wymagany jest zakupiony kod
$url = "/check_code.php?id=".$id."&code=".$code."&check=".$check."&type=".$type."&del=".$del;
$header = "";
$response = "";
if (!($request=fsockopen('allpay.pl',80
,$errno,$errstr))) exit($errstr); else {
fwrite($request,"GET ".$url." HTTP/1.0rnHost: allpay.plrnrn"); if (preg_match('/Transfer-Encoding:s+chunkedrn/',$header)) do {
$byte = "";
$chunk_size="";
do {
$chunk_size.=$byte;
} while ($byte!="r"); // till we match the CR
fread($request, 1
); // also drop off the LF $chunk_size=hexdec($chunk_size); // convert to real number $response.=fread($request,$chunk_size); fread($request,2
); // ditch the CRLF that trails the chunk } while ($chunk_size); // till we reach the 0 length chunk (end marker)
else {
if (preg_match('/Content-Length:s+([0-9]*)rn/',$header,$matches)) { $response=fread($request,$matches[1
]); } else {
while (!feof($request)) $response .= fread($request, 4096
); }
}
// close connection
}
$status = $dane[0];
$czas_zycia = rtrim($dane[1
]);
if ($status == 0
) {print "Wprowadzony kod jest niepoprawny lub skonczyla sie jego waznosc."; exit;} # gdy kod niepoprawny else
{ # gdy kod poprawny:
if (!isset($_COOKIE['ActiveCode'])) {
}
else
{
}
header("Location: ".$page); # w3ączenie strony g3j }
?>
tylko teraz pytanie jak go przerobic aby system rozpoznawal czy uzytkownik wybral abonament na 7,14, czy 30 dni?