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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.