Parsing URL with PHP
Hi
I am having difficulty here. I am attempting to integrate a site with Worldpay - a 'subscriber' would fill out their details within my site. Once payment has either been authorised or not, the information can be passed back to a URL of my choice for my information. And here is the difficulty.
The information is passed back in the URL using the POST method, using their Callback facility. An example of this information is this (found on the WorldPay website)...
instId=38290&email=tiq%40uk.worldpay.com&transTime =999178402000&country=GB&rawAuthCode=A&amount=14.9 9&installation=38290&tel=0123+456789012&address=Te st+Road%-D%0ATest+Town%0D%Test+City&futurePayId=76486&MC_lo g=2379&rawAuthMessage=authorised+(testMode+always+ Yes)&authAmount=23.11&amountString=%26%23163%3B14. 99&cardType=Visa&AVS=0001&cost=14.99&currancy=GBP& testMode=100&authAmountString=EUR23.11&fax=01234+5 678901&lang=en&transStatus=Y&compName=Ian+Richards on&authCurrency=EUR&postcode=AB1+2CD&authCost=23.1 1&desc=Test+Item&countryMatch=S&cartId=Test+Item&t ransId=12227758&callbackPW=38290&M_varl=fred&authM ode=E&countryString=United+Kingdom&name=WorldPay+T est
This is quite a massive string. Obviously the majority of it is not important. But I would like to extract a select number of the variables (such as name, address and whether or not the payment was authorised) and store them in a database.
Has anyone any ideas on how to do this please? A prompt response would be greatly appreciated.
Kind regards,
Turklet
|