Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: HTML PHP
Hey guys I have a little problem.
I need 2 actions in 1 form.
the one action is on my own side (I want to insert sth. in a database) and the other action takes you to a payment system.
Somebody knows how to do this?
Posted 20-Jan-13 4:30am
Comments
OriginalGriff at 20-Jan-13 9:51am
   
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Typical recommended approach would be:
 
1. Form is submitted to your page with custom logic. ( insert necessary data into db etc)
2. Page validates data, if validation fails - displays form again with validation errors
3. If data are OK - saves necessary data into db and issues 301 redirect to some "navigate to payment engine" page
Redirect is recommended to avoid form resubmitting if user presses reload page.
4. "Navigate to payment engine" page might include form markup with fields expected by payment engine + JavaScript code to submit form once page is loaded. It is good idea to show submit button on this form as well. Text could be "press here if you are not navigated to payment engine in 5 seconds"
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,382


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 20 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100