I'm trying to write a script to send data to authorize.net and I've run into a snag.

Here is what I have to do:

- present the user with a form to provide personal information.
- send that data to authorize.net
- using the very same page that sent the data, accept the result of the data back from authorize.net (credit card accepted, declined, whatever)
- process that data, and do one of two conditions based on whether the customer was accepted.

this doesnt seem that hard, but having to do it with one script has me stumped...can anyone help? even very rough pseudo code
to point out the basic concept here would be great.

Thanks again, guys
Luke