Jump to content

POST to PHP File and update DB?


dayo

Recommended Posts

Hello all

 

I am newbie learning PHP stuff and can anyone please tell me if this scenario is possible on a payment system I am working on.

 

1) User Selects items from website

2) Information is passed to 3rd party site to process payment including url to a php file on website

3) 3rd party site sends information back to php file

4) Database is updated

 

So far, steps 1 & 2 are sucessful and the payment is processed, but getting the data back from the 3party site and updating the DB is proving difficult.

 

 

The code below is what is in the php file the 3rd party site is posting variables back to.

 

 

 

//Insert Transaction Details into table
$tab_list = "mb_date_ordered, mb_pay_to_email, mb_pay_from_email, mb_merchant_id, mb_transaction_id, mb_mbtransaction_id, mb_mbamount, mb_mbcurrency, mb_status, mb_md5sig, mb_zcmd5, mb_amount, mb_currency"
$tab_vals = "'date("Y-m-d H:i:s")','$_REQUEST[pay_to_email]', '$_REQUEST[pay_from_email]', '$_REQUEST[merchant_id]', '$_REQUEST[transaction_id]', '$_REQUEST[mb_transaction_id]', '$_REQUEST[mb_amount]', '$_REQUEST[mb_currency]', '$mbStatusText', '$_REQUEST[md5sig]', '$mbZCMD5', '$_REQUEST[amount]', '$_REQUEST[currency]'"

$zc_con = mysql_connect("host","u_name","p_word");

mysql_select_db("db_name", $zc_con);

$zc_query="INSERT INTO MYTABLE ($tab_list)
VALUES ($tab_vals)");

mysql_close($zc_con)

 

 

The question is whether a site posting info to a php file can trigger this code and if it can, whether I have screwed up in the structure.

 

Thanks for your time

Link to comment
https://forums.phpfreaks.com/topic/39849-post-to-php-file-and-update-db/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.