Forum Moderators: coopster

Message Too Old, No Replies

Using one HTML button to email and connec to another HTML page

2 functions with one HTML button?

         

Alina

1:34 pm on May 13, 2003 (gmt 0)

10+ Year Member



Hello,

Can someone help me with my question?

I am trying to write a shopping cart application. When a visitor opts for CheckOut,
his selected items are displayed together with his contact details. When he clicks
"Pay for Items" (within an HTML form) the HTML connection goes to WorldPay -
so that he is then able to enter his credit card details.

Is there a way of using one button to do 2 thngs:

1. Send my client an email of the visitor's selected items, and an order-id.
2. And then going to world pay.

I know about pointing the "Pay for Items" form to a PHP script which does an email.
But how can i then connect to WorldPay without requiring my visitor to click any more buttons.

World Pay have a callback facility - but i would like to explore any other options before
settling for that one.

Grateful thanks for any information received,

Alina

PsychoTekk

2:10 pm on May 13, 2003 (gmt 0)

10+ Year Member



assuming the user has javascript enabled, you might use
<FORM onsubmit="handler()" ...>
or modify the email script so that it fits you needs

Birdman

2:20 pm on May 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sure, just use a the PHP [php.net] header() [php.net] function.

You will have to build the querystring by using the posted variables from the form.

header("Location: h*tp://www.worldpay.com?prod_id=$prod_id&qty=$qty...");

Simply add:
?form-element=$form-element&form-element2=$form-element2&form-element3...

for each form element using the elements specific name.

Alina

4:08 pm on May 13, 2003 (gmt 0)

10+ Year Member



PsychoTekk - i am not very good with javascript - need to learn this properly. I think i will use headers as Birdman suggested.

Thank you both for your help.

Alina