Hallo, Ik ben bezig met een pay systeempje dat werkt met daopay. Alles lukt aardig. Maar op het laatste gaat het even fout.
Dit is het script dat het uitvoert.
<?
/**
* pincheck.php
*
* Please place this file at the specified backlink-url.
* This file will take the respective parameters to call the Daopay pincheck.
*
*/
$appcode = 49083; // 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 "For more info ask [email protected] ";
include 'bjfom$/995125/ring.php';
}
else {
// PIN code invalid/expired
echo "PIN code invalid/expired";
}
}
else {
// Connection error
echo "Connection error: Can not connect to Daopay";
}
}
?>
Dit is include 'bjfom$/995125/ring.php';
<FORM method="post" action="<? echo $PHP_SELF;?>">
<p>Characternaam:
<input name="aid" type="textfield" />
<select name="sg">
<option value="33371">Donater Ring - lvl.0</option>
</select>
<input type="submit" value="buy" name="koop" />
</form>
<?
include('config.php');
$naam = anti_injection($_POST ["aid"]);
$itemid = anti_injection($_POST ["sg"]);
$cid = ("SELECT CID FROM Character where Name='$naam'");
$query = odbc_exec($connect,$cid);
odbc_fetch_row($query);
$cidnr = odbc_result($query, 1);
if (isset($_POST["koop"]))
{
if (empty($naam))
{
echo ('<br>You must enter your character name!');
}
else
{
echo ('<br>Succesvol gekocht!');
odbc_exec ($connect, "INSERT INTO CharacterItem (CID, ItemID) VALUES ('$cidnr', '$itemid')");
}
}
?>
Maar omder er else in die ene staat gebeurd er dit:
Je komt erop. Je tpyt je naam in. Maar daarna komt de error code verlopen. Omdat in die include een "else" staat.
Hoe moet je dit fixen?
1.014 views