Forums

Save on the DB and POST to another page

stecciu 02 Feb, 2012
Hello to everyone,

I'm in trouble with this amazing component..

I need to do a form that save the fields on a record in the DB and then redirect the user to another page in the same server but out of the joomla core (example.php). In that page I need to have all the saved data of the record in the DB by a POST send.

The question is: how I can have the data of the record (in the DB) that is generated by the fields in the form by a simple POST call?

I saw I have an array when the DB Save action is called but I can't find that!?


What I did:

On Load:
Show HTML

On Submit:
DB Save
Redirect URL
Redirect USER

NOTE: the form is correctly saving in the DB and the redirect works fine.

Please help me, I'm going crazy!!!!
stecciu 02 Feb, 2012
Ok, I'll try to explain my problem better..

How do you send the fields value of a form via POST to another page?

Is there a way?
GreyHead 02 Feb, 2012
Hi stecciu,

Do you need to send the user the to page outside Joomla!? or just send the data?

If you need to send the user and you can use Get instead of Post then use the Redirect URL and Redirect User actions; if you only need to send the data then use the CURL action; if you want to send the user and you have to use POST then you can build a 'dummy' form with the data in hidden inputs and use JavaSCript to submit it (or a single button labelled 'Confirm' or 'Continue').

Bob
stecciu 02 Feb, 2012
I need to send some datas to a bank in post mode (outside joomla) and send the user on the payment page.

I can't use the get method, just the post.

I tried with the cURL action but I can't have the data in post, I didn't find them. I tried with this code:



$orderid = $_POST["chronoform_data"]["cf_id"];
$orderid = $_POST["cf_id"];
$orderid = $_POST["chronoform_data_cf_id"];



and with some other way but it doesn't work. I tried to check if the data were sent with this:



if(count($_POST)>0) {
echo ("OK");
}else{
echo ("KO");
}



but nothing to do..

I didn't understand the third way you told me, the one with the dummy form..
Could you explain me how to do that?
Just another question: how I can put some other data in the post calling without putting it in some hidden box in the form?
I red that there is a way to put the data in the array, is it possible?

For now thanks a lot for your help!
stecciu 02 Feb, 2012
I'm sorry... with the cURL way I have the same page in joomla so I need to do the third way I guess..
This topic is locked and no more replies can be posted.