Forums

Please help - Chronoforms 7 - php get variables from form

kraken17 11 Aug, 2021
I have written a php program that produces a costing for a system based on three fields within my form. I am having problems getting the field information from my form into my php program. I have used php before and produced the correct information but cf7 seems to be doing things in a different way.

$overalllength = $form->data['longest_side'];
// $overalllength = $_GET['overalllength'];
echo $overalllength . " Real Data:" . $form->data['logest_side'] . "\n";
$coverage = $form->data['coverage'];
// $coverage = $_GET['coverage'];
echo $coverage . "\n";
$quantity = $form->data['quantity'];
// $numofbadges = $_GET['numofbadges'];
echo $numofbadges . "\n";
$priceofbadges = 0;
// echo '<script type="text/javascript">';
echo $overalllength; //not showing an alert box.
// echo '</script>';

I cannot find anything about cf7 and running php code.
kraken17 12 Aug, 2021
Answer
Incase anyone is also looking for this information the syntax is :

$variable = $this->data('form_variable');

This assigns the form field to the variable name.
You need to login to be able to post a reply.