SA-MP Forums Archive
[PHP] Donation Page. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [PHP] Donation Page. (/showthread.php?tid=550812)



[PHP] Donation Page. - MD5 - 14.12.2014

Could anyone guide me bitterly on how I would create a simple donation page that checks the account, and if it's invalid or non-existent then shouldn't let them donate for it. Then redirects them to PayPal with the account username in the description, but also you can select which V.I.P package or amount you want to pay.

Regards,
MD5

ps. I suck at PHP.


Re: [PHP] Donation Page. - Abagail - 15.12.2014

You'd need to use the paypal API. Additionally, I don't know what kind of user-saving system you use:
I am guessing that you are using MySQL so basically this is a snippet from my gamemode(Xenon Gaming):

pawn Код:
stock DoesAccountExist(szName[])
{
     new query[500];
     mysql_format(MySQLCon, query, sizeof(query), "SELECT * FROM `players` WHERE `user` = '%e' LIMIT 1", szName);
     mysql_tquery(MySQLCon, query, "", "");
     new rows, fields;
     cache_get_data(rows, fields, MySQLCon);
     if(rows)
     {
        return 0;
     }
    else
    {
        return 1;
    }
}
Basically you need to check if a row is exists. And as for the paypal API, just ****** it, and ****** will assist you with that.