[eluser]coldfire82[/eluser]
Here is the pickle. BTW i am new to CI
structure is:
+views
- register
- login
- ...
+controller
- itempurchase
- register_user
- ...
I have a payment page at my (shopping) site which takes signup information IF the user is NOT signed in. When the customer enters the payment information along with singUp information, I want to do two operations. i.e.
1. Register a user
2. Process payment information. (like billingname,city,country, item, quantity etc., here, this information is then stored in a DB table)
The problem is, the html <form> is 1 and I want to accomplish these 2 separate operations in one go i.e. on form submit, it registers ther person and continue processing the payment. How to do that? Because, If I submit the form, it can either go to register_user or itempurchase and there is no interoperability between controllers (as far as i know, and I dont know v.much about CI
)
the ideas in my mind were to
idea 1: make the action of the form as "register_user" and by somehow either call the function in another controller or copy the controller function which is in itempurchase.
(i think this is totally against rules)
idea 2: make the action of the form as "register_user" and create a dummy view like "autopayment". Then, create a hidden form there and fill all variable values which will come in an array when i will load this view and at the end of the form, send this form using javascript to "itempurchase" controller.
idea3: viceversa of idea2. but with some tricky coding like first register the person and then process the controller.
idea4: put "register_user" in some common library and access it from the "itempurchase" controller.
i am really in trouble here...maybe its not so difficult if i know more abt the capabilities of CI!
SOS i am stuck!