Donation script doesnt work the way i want it:(

Hi all,

first of all, i hope i can get some help here, cause im realy stuck:( I am relativly new in the php/mysql scene, worked on some minor projects before, but this is my first big one.

Okay, the idee was to create a donate page, true admin menu the admin can edit, add and delete donation types. The way this donation file will be used is for a online game, and when you donate, you receive a item.

Normaly i get a list of items you can purchace trough donation, but i’d like to alter the page so you can see one small dropdown menu, the name of the character and a donation button. This is what i got, but it doesnt work:(

[code]<?php if($user['id']>0){ ?>

.postContainerPlain { font-family:arial,palatino, georgia, verdana, arial, sans-serif; color:#000000; padding:5px; margin-bottom: 4px; font-size: x-small; font-weight: normal; background-color: #E7CFA3; background-image: url('<?php echo $MW->getConfig->temp->template_href;?>images/light.jpg'); border-style: solid; border-color: #000000; border-width: 0px; border-bottom-width:1px; border-top-width:1px; line-height:140%; } .postBody { padding:10px; line-height:140%; font-size: small; } .title { font-family: palatino, georgia, times new roman, serif; font-size: 13pt; color: #640909; } small {font-family: verdana, arial, sans-serif; font-size:8pt; font-weight:normal;} .smallBold {font-family:verdana, arial, sans-serif; font-size:11px; font-weight:bold;} #text { position: absolute; top: 128px; left: 0px; } #char { position: absolute; top: -103; left: -20; } #wrapper { position: relative; z-index: 100; } #wrapper99 { position: relative; z-index: 99; } getConfig->temp->template_href;?>images/donation/bg.jpg">
        <td><div id = "wrapper"><div id = "char"><img src="<?php echo $MW->getConfig->temp->template_href;?>images/donation/body.gif" width="83" height="177" alt=""></div></div></td>
        <td valign = "top"><img src="<?php echo $MW->getConfig->temp->template_href;?>images/donation/left.jpg" width="343" height="179" alt=""></td>
getConfig->temp->template_href;?>images/donation/plainbox-top-left.gif" width = "3" height = "3" border = "0"> getConfig->temp->template_href;?>images/donation/plainbox-top.gif"> getConfig->temp->template_href;?>images/plainbox/plainbox-top-right.gif" width = "3" height = "3" border = "0">
getConfig->temp->template_href;?>images/donation/plainbox-left.gif"> getConfig->temp->template_href;?>images/parchment/plain/light3.jpg');" NOWRAP> getConfig->temp->template_href;?>images/donation/plainbox-right.gif">
getConfig->temp->template_href;?>images/donation/plainbox-bot-left.gif" width = "3" height = "3" border = "0"> getConfig->temp->template_href;?>images/donation/plainbox-bot.gif"> getConfig->temp->template_href;?>images/donation/plainbox-bot-right.gif" width = "3" height = "3" border = "0">

// End Templates Start Content //
if (isset($_GET[‘pay’]) && $_GET[‘pay’] == ‘finish’){
$MANG = new Mangos;
$ep = $CHDB->select(“SELECT * FROM characters WHERE account=’”.$user[‘id’]."’");
foreach($ep as $ap){
$charid = $ap[“guid”];
$q = $DB->select(“SELECT * FROM paypal_payment_info WHERE itemname=’”.$charid."’ AND item_given != ‘1’");

    if(count($q) > 0){
        foreach($q as $data){
            echo 'Payment Done.<br />';
            if ($data['item_given'] != 1){

                // Aditional payment checks can be done here.
                $donations_template = $DB->selectRow("SELECT * FROM `donations_template` WHERE id='".$data['itemnumber']."'");
                // Ok, we must check if we actually got the money that we asked for.
                if ($donations_template['donation'] > $data['mc_gross']){
                    $NOT_MAIL = TRUE;
                    $NOT_MAIL = FALSE;

                if ($NOT_MAIL == FALSE){
                    if ($MANG->mail_item_donation($data['itemnumber'], $ap['guid'],$ap['txnid']) == TRUE){
                        echo $lang['items_sent']."<br /><ul><li>".$lang['username'].": ".$user['username']."</li><li>".$lang['charname'].": ".$ap['name']."</li><li>".$lang['donate']." ".$lang['l_delkey_id'].": ".$data['itemnumber']."</li><li>".$lang['paymentstatus'].": ".$data['paymentstatus']."</li></ul>";
                                            echo $lang['items_could_not_be_sent'];
                    echo "<ul><li>".$lang['donation_not_face_value']."</li></ul>";
// Add message if we dont find any donation.
if ($no_chars){
    echo "<p>".$lang['no_donations_found_for']." <b>".$user['username']."</b>!</p>";

}elseif (isset($_GET[“pay”]) && $_GET[“pay”] == ‘dublicate’){


<?php echo $lang['donation_page_desc'];?>

<? $query="SELECT * FROM `donations_template` ORDER BY id"; ?> 1. Select The Gift You Would Like:

$q = $DB->select(“SELECT * FROM donations_template ORDER BY id”);
foreach($q as $data){
$id = $data[‘id’];
echo “<option value=’”.$data[‘id’]."’>".$data[‘description’]." (€ “.$data[‘donation’].”)";



2. <?php echo $lang['donation_pick_character'];?>

<?php $qray = $CHDB->select("SELECT * FROM `characters` WHERE account='$user[id]'"); foreach($qray as $d){ echo "".$d['name'].""; } ?>

3. Click here to receive the item :

<?php } } ?>[/code]

The list shows, the items are put in the dropdown box, but when you select one, and press donate, on paypal you dont see the item you’ve chosen, but the last one of the dropdown list:(. This happens to all of the select items.

Does anyone know what i did wrong and how to fix this problem?

ps, im dutch, so sorry for my bad english

Sponsor our Newsletter | Privacy Policy | Terms of Service