Wrox Programmer Forums
|
BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
This is the forum to discuss the Wrox book Beginning PHP4 by Wankyu Choi, Allan Kent, Chris Lea, Ganesh Prasad, Chris Ullman; ISBN: 9780764543647
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 27th, 2004, 02:40 PM
Registered User
 
Join Date: Nov 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

 
Old November 27th, 2004, 09:24 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Get the variables with superglobals...

var1=foo&var2=bar

$_GET['var1'] == 'foo'
$_GET['var2'] == 'bar'

Depends what kind of database, I suggest you read the PHP manual... http://www.php.net/manual/en

-Snib
Where will you be in 100 years?
Try new FreshView 0.2!





Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP URL manih Pro PHP 2 December 3rd, 2007 02:27 PM
Error in php xml parsing... caught PHP How-To 0 April 12th, 2007 03:54 AM
Reading current http url dynamically in php hi2php PHP How-To 1 November 1st, 2006 04:16 AM
Hidden redirect but no php parsing klokkie Beginning PHP 2 August 5th, 2004 11:09 AM
Parsing in PHP Walter G Pro PHP 2 August 14th, 2003 01:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.