I am using chronoform version 4.0 RC2.0
I have created a form which submits to paypal and on payment the paypal ipn calls back that forms paypal listener. If the paypal transaction is verified then a “custom code” action should run which contain the following.
at the inital form submision, My form sends a variable called 'custom' which contains a unique id, which is used by the "custom code" action in the listner to identify which database record is associated with the call to the listener and update that record to paid.
My problem is that I dont know how to properly access the $_POST array from inside the action, so I am using $form->data['custom']. Is this correct? or should I be accessing it in another way? (as the code above is not working when i use $form->data['custom'])
I am finding it hard to test $form->data as i can’t see the output when it runs.
I am also unsure whether I should be running this code when it is at view or controller ?
Thankyou in advance
I have created a form which submits to paypal and on payment the paypal ipn calls back that forms paypal listener. If the paypal transaction is verified then a “custom code” action should run which contain the following.
<?php
$con = mysql_connect("*****","*******","**********");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("*********", $con);
$query ="UPDATE
`jos_chronoforms_data_request_permit`
SET
`have_they_paid` = 1
WHERE
`jos_chronoforms_data_request_permit`.`custom` = ";
$query .= "'".$form->data['custom']."'";
mysql_query($query);
mysql_close($con);
?>
at the inital form submision, My form sends a variable called 'custom' which contains a unique id, which is used by the "custom code" action in the listner to identify which database record is associated with the call to the listener and update that record to paid.
My problem is that I dont know how to properly access the $_POST array from inside the action, so I am using $form->data['custom']. Is this correct? or should I be accessing it in another way? (as the code above is not working when i use $form->data['custom'])
I am finding it hard to test $form->data as i can’t see the output when it runs.
I am also unsure whether I should be running this code when it is at view or controller ?
Thankyou in advance