Reply to Re: $_POST values to Worldpay https thru a script and not a form

Your name:

Reply:


Posted by d on 04/11/06 23:09

"Angelos" <angelos@redcatmedia.net> wrote in message
news:YrydnXTKFJ_jIKbZRVnyvg@bt.com...
> NC wrote:
>> Angelos wrote:
>>
>>>I used curl like in the example bellow:
>>>$urlString = "cartId=56997&name=fred";
>>>$ch = curl_init("https://select.worldpay.com/wcc/purchase");
>>>curl_setopt($ch, CURLOPT_HEADER, 0);
>>>curl_setopt($ch, CURLOPT_POST, 1);
>>>curl_setopt($ch, CURLOPT_POSTFIELDS, $urlString);
>>>curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
>>>curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>>>echo $data = curl_exec($ch);
>>>curl_close($ch);
>>>
>>>but thats not working as I expect it to work.
>>>I would excpect to redirect to https://select.worldpay.com/wcc/purchase
>>>and post the values in the $urlString.
>>>
>>>My code sort of does that but it includes the worldpay page in my
>>>website.
>>
>>
>> Yes, because you are telling it to do it. Get rid of echo, and it
>> won't... Cheers, NC
>>
> But when I get rid of the echo it still doesn't redirect me to worldpay :s

It's redirecting the curl client to the worldpay site, and only if the curl
client has been configured to follow redirects. That's not going to help
anyone :)

Instead of doing it like this, why not have your PHP construct a hidden form
that you submit using javascript to the url in question. That would
redirect the client to worldpay, instead of just the curl client.

hope that helps!

dave

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация