Page 1 of 1

Forms and more forms :)

Posted: Thu Mar 26, 2009 5:56 am
by ajtruckle
Hello

I would like to ask your advice about a certain matter. I have a form which collects details from the customer. At the moment it is designed to directly connect to the worldpay server.

But what I want to do is alter it to that it re-directs to my own PHP processer file. My file should then do several tasks with the data they posted:

1. Examine the check option field and register the user on a mailshot

2. Email the anticipated order details to the shop (even though the task is incomplete)

3. Send the details to worldpay.

So my question relates to item 3. Can I have a hidden form on a PHP page that the user can't see that automatically submits when the page is processed?

Or is there any other way that I can do this?

Thanks in advance.

Andrew

Re: Forms and more forms :)

Posted: Thu Mar 26, 2009 6:03 am
by mattpointblank
Send the form to your own php page which processes the relevant data, then maybe use AJAX to $_POST the data to the Worldpay script automatically?

Re: Forms and more forms :)

Posted: Thu Mar 26, 2009 6:05 am
by ajtruckle
Thanks for your reply. I can certainly do the first bit as I have already created contact pages and use my own PHP processor to re-direct the user based on the results etc.. But as for AJAX, this is something I have never used.

I am certainly not a PHP guru but I have a good knowledge of C++ and and feel at home with PHP thus far.

Andrew

Re: Forms and more forms :)

Posted: Thu Mar 26, 2009 7:05 am
by mattpointblank
Have a read through this: http://www.tizag.com/ajaxTutorial/

Re: Forms and more forms :)

Posted: Thu Mar 26, 2009 7:17 am
by ajtruckle
Thanks. It turns out that worldpay also support a URL command line with the various values. So I am looking into that first.

Andrew

Re: Forms and more forms :)

Posted: Thu Mar 26, 2009 7:25 am
by mattpointblank
Cool - that makes using AJAX easier - you can send a $_GET request pretty easily to a specific URL, which that tutorial should explain.