Witam,
Posiadam taki oto skrypcik DAOPAY - sprawdzanie kodów:
<?
/**
* pincheck.php
*
* Please place this file at the specified backlink-url.
* This file will take the respective parameters to call the Daopay pincheck.
*
*/
$appcode = 206; // Enter your Appcode here
$prodcode = trim($_GET["prodcode"]);
$pin = trim($_GET["pin"]);
if($appcode != $_GET["appcode"]) {
exit;
}
if (strlen($prodcode) && strlen($pin)) {
$handle = fopen("http://daopay.com/svc/pincheck?appcode=".$appcode."&prodcode=".$prodcode."&pin=".$pin, "r");
if ($handle) {
$reply = fgets($handle);
if (substr($reply,0,2) == "ok") {
/**
* Payment successfully completed!
*
* Put your PHP Code here, wich will deliver the product to respective client.
* e.g. redirection to a download or update the user in a database.
*/
echo "Payment successfully completed!";
}
else {
// PIN code invalid/expired
echo "PIN code invalid/expired";
}
}
else {
// Connection error
echo "Connection error: Can not connect to Daopay";
}
}
?>
Nie znam praktycznie PHP, więc byłbym mile zaskoczony gdyby ktoś zdecydował się podesłać tu gotowiec, ewentualnie proszę o kontakt GG: 25620970
Chciałbym aby implementacja wyglądała w sposób następujący:
Zostaje stworzony textbox, do którego wpisywany będzie kod, który po wciśnięciu przycisku obok textboxa będzie wywoływał ten powyższy skrypt. Do powyższego skrypu chciałbym jeszcze dodać fragment edytujący kolumnę w bazie danych (Microsoft SQL Server), gdy kod będzie poprawny.
Z góry dziękuję za pomoc.