Forms and more forms :)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ajtruckle
Forum Newbie
Posts: 3
Joined: Thu Mar 26, 2009 5:52 am

Forms and more forms :)

Post 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
mattpointblank
Forum Contributor
Posts: 304
Joined: Tue Dec 23, 2008 6:29 am

Re: Forms and more forms :)

Post 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?
ajtruckle
Forum Newbie
Posts: 3
Joined: Thu Mar 26, 2009 5:52 am

Re: Forms and more forms :)

Post 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
mattpointblank
Forum Contributor
Posts: 304
Joined: Tue Dec 23, 2008 6:29 am

Re: Forms and more forms :)

Post by mattpointblank »

Have a read through this: http://www.tizag.com/ajaxTutorial/
ajtruckle
Forum Newbie
Posts: 3
Joined: Thu Mar 26, 2009 5:52 am

Re: Forms and more forms :)

Post 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
mattpointblank
Forum Contributor
Posts: 304
Joined: Tue Dec 23, 2008 6:29 am

Re: Forms and more forms :)

Post 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.
Post Reply