iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-17-2005, 09:51 PM
WebProWorld Member
 
Join Date: Apr 2004
Location: Australia
Posts: 28
newmarket RepRank 0
Default Posting form data from a script

I have been trying to figure this out for a while and would appreciate any help.

I use Worldpay to process payments for my site. All of the processing is handled on their server, so I have no idea what happens if the shopper clicks the "buy now" (form submit) button.

I would really like to find someway to log that the form was submitted and the shopper sent to Worldpay. I want to use this to help me track where the shopping cart is being abandoned.

I have tried calling a php script as the action on the form, from which I could log any data I need.

The problem is that I can't get the POST data to Worldpay in any way that they like. I've tried using header(), cURL, fsockopen (my host doesn't have openssl installed).

I would appreciate any help pointing me in the right direction (an example would be fantastic). I am happy to use something other than PHP -- can perl help.

Thanks in advance for your help.
Reply With Quote
  #2 (permalink)  
Old 07-18-2005, 04:14 AM
WebProWorld Veteran
 
Join Date: Aug 2003
Location: Cornwall, UK
Posts: 972
speed RepRank 1
Default

We use curl with openssl to talk to Worldpay from our PHP shopping cart, as far as I'm aware Worldpay won't accept data over a standard http connection it must be https.

Therefore I'd suggest asking the host to install openssl for curl if they won't then change hosts.
Reply With Quote
  #3 (permalink)  
Old 07-18-2005, 07:24 PM
WebProWorld Member
 
Join Date: Apr 2004
Location: Australia
Posts: 28
newmarket RepRank 0
Default

Thanks Speed,

I installed cURL and openssl on my development system, but I haven't been able to figure it out!

I can get the POST off to Worldpay, but the page that comes back appears as if it is on my server. As a result all of the relative links on worldpay's page don't work (images etc.). Of course, Worldpay doesn't like it..

Can you recommend a resource helping me to learn cURL? I've been through all of the documenation on their site, but I just can't get my head around it!

Thanks again and it sounds like I need to persevere with cURL.

Cheers,
Reply With Quote
  #4 (permalink)  
Old 07-19-2005, 03:49 AM
WebProWorld Veteran
 
Join Date: Aug 2003
Location: Cornwall, UK
Posts: 972
speed RepRank 1
Default

I miss read what you were after, but if you are getting data back then the post works.

The reason that everything appears to be on your server is that the PHP application is acting as the browser and then displaying the results to the visitor (you).

The PHP app is running on your domain it's output is on your domain and therefore all relative URLs are on your domain.

If you read the HTML returned you can insert a <base href="blah" /> tag into the head or rewrite the paths to be absolute. Either way the page will show to the visitor as if it is on your domain and not Worldpays, the page will no longer be shown over an encrypted link unless you have an SSL certificate for your domain.

I'm assuming you are using Select Checkout, it would be better to collect items into a cart and then pass all the information to the Select Junior interface, as then you can track just about anything you want while leaving WP interface alone, it's only the final card entry stages you can't see.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:28 AM.



Search Engine Optimization by vBSEO 3.3.0