Call PHP form

Home Forums Quform WordPress Call PHP form

This topic is: resolved
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #6487
    brabox
    Participant

    Hello,

    I have made a simple calculator using PHP and a simple form in HTML with tables for the front end.

    Is there any way i can connect my PHP using thr Quform?

    i know i would have to change each element and match it in my PHP but how would i go by “calling” or connecting the qufrom to it.

    I have attached both the Calculator in PHP and the HTML. Please let me know if what i want to accomplish is possible.

    ##edit: Did not let me attach php file. will display code below.##

    <code>

    <html>
    <head>
    <title>BraBox – Economy Service Quote</title>
    </head>
    <body>
    <h1>BraBox Economy Service Quote</h1>
    <h2>Quote Results</h2>
    <?php
    //define variables and set to empty values
    $DOCUMENT_ROOT = $_SERVER[‘DOCUMENT_ROOT’];
    $nameqty = $_POST [‘nameqty’];
    $emailqty = $_POST [’emailqty’];
    $addressqty = $_POST [‘addressqty’];
    $cityqty = $_POST [‘cityqty’];
    $stateqty = $_POST [‘findstate’];
    $zipcodeqty = $_POST [‘zipcodeqty’];
    $valueqty = $_POST [‘valueqty’];
    $lengthqty = $_POST[‘lengthqty’];
    $widthqty = $_POST[‘widthqty’];
    $heightqty = $_POST[‘heightqty’];
    $weightqty = $_POST[‘weightqty’];
    $inorcm = $_POST [‘inorcm’];
    $lborkgorozorg = $_POST [‘lborkgorozorg’];
    //starting values
    $economyfreighttotal = 0.00;
    $insurancetotal = 0.00;
    $grandtotal = 0.00;
    //llength, wwidth, and hheight are the variables for length width and height considering if box needs to be flipped.
    $llengthqty = 0.00;
    $wwidthqty = 0.00;
    $hheightqty = 0.00;
    if ($lengthqty >= $widthqty){
    $llengthqty = $lengthqty;
    $wwidthqty = $widthqty;
    $hheightqty = $heightqty;
    }
    else {
    $llengthqty = $widthqty;
    $wwidthqty = $lengthqty;
    $hheightqty = $heightqty;
    }
    //llengthqty, wwidthqty, and hheightqty separated into In or Cm
    $lengthin = 0.00;
    $widthtin = 0.00;
    $heightin = 0.00;
    $lengthcm = 0.00;
    $widthcm = 0.00;
    $heightcm = 0.00;
    $finalweightinlb = 0.00;
    if ($inorcm == “In”){
    $lengthin = $llengthqty;
    $widthin = $wwidthqty;
    $heightin = $hheightqty;
    }
    if ($inorcm == “Cm”){
    $lengthcm = $llengthqty;
    $widthcm = $wwidthqty;
    $heightcm = $heightqty;
    }
    if ($lborkgorozorg == “Lbs”){
    $weightlb = $weightqty;
    }
    if ($lborkgorozorg == “Kgs”){
    $weightkg = $weightqty;
    }
    if ($lborkgorozorg == “Oz”){
    $weightoz = $weightqty;
    }
    if ($lborkgorozorg == “Gs”){
    $weightg = $weightqty;
    }
    //girth calculation
    $totalgirthin = ($lengthin + (2*($widthin + $heightin)));
    $totalgirthcm = ($lengthcm + (2*($widthcm + $heightcm)));
    //insurance calculation
    $insurancetotal = (($valueqty / 100) * 1.25);
    if ($insurancetotal < 5.00) {
    $insurancetotal = 5.00;
    }
    //quote summary
    echo ‘<p>Quote processed at ‘;
    echo date (‘H:i, jS F Y’);
    echo “</p>”;
    echo ‘<p> Hello ‘.$nameqty. ‘. Your quote summary is: </br>’;
    echo ‘1 piece with dimensions of ‘.$lengthqty.’ ‘.$inorcm.’ length x ‘.$widthqty.’ ‘.$inorcm.’ width x ‘.$heightqty.’ ‘.$inorcm.’ height, at ‘.$weightqty.’ ‘.$lborkgorozorg.’.</br>’;
    echo ‘Item with a value of $’.number_format($valueqty,2).’ USD.</p>’;
    echo ‘Shipping destination: </br>’;
    echo $addressqty;
    echo $cityqty.’, ‘.$stateqty.’, Brazil, ‘.$zipcodeqty.'</p>’;
    //girth limiter in – exit marker
    if (($inorcm == “In”) && ($totalgirthin > 79)){
    $economyerrorresponse=’Please note the dimensions of the item you are quoting exceed the limits for Economy service. You can re-submit your quote using a smaller box.</br> Example: Can you split your box into 2 boxes of 15 x 15 x 15 inches? If so, you may quote for 1 box at 15 x 15 x 15 inches to know how much it would cost to send each separately.</br> If this item is new, you can also check our Premium or Caixa Rapida service.</br>’;
    $continueeconomycalculation = ‘No’;
    $mailyesno = ‘No’;
    }
    //girth limiter cm – exit marker
    if (($inorcm == “Cm”) && ($totalgirthcm > 195)){
    $economyerrorresponse=’Please note the dimensions of the item you are quoting exceed the limits for Economy service. You can re-submit your quote using a smaller box.</br> Example: Can you split your box into 2 boxes of 38 x 38 x 38 centimeters? If so, you may quote for 1 box at 38 x 38 x 38 centimeters to know how much it would cost to send each separately.</br> If this item is new, you can also check our Premium or Caixa Rapida service.</br>’;
    $continueeconomycalculation = ‘No’;
    $mailyesno = ‘No’;
    }
    //value limiter – exit marker
    if ($valueqty > 2700){
    $economyerrorresponse=’Please note the value of the item you are quoting exceeds the limit. Please quote a less expensive item.’;
    $continueeconomycalculation = ‘No’;
    $mailyesno = ‘No’;
    }
    //weight limiter lbs – exit marker
    if (($lborkgorozorg == “Lbs”) && ($weightqty > 66)){
    $economyerrorresponse= ‘Please note the weight of the item you are quoting exceeds the limits for Economy service. You can re-submit your quote using a lighter item.</br> If you can split the item into more boxes, you can quote each separately.</br> If this item is new, you can also check our Premium or Caixa Rapida service.</br>’;
    $continueeconomycalculation = ‘No’;
    $mailyesno = ‘No’;
    }
    //weight limiter kgs – exit marker
    if (($lborkgorozorg == “Kgs”) && ($weightqty > 29)){
    $economyerrorresponse=’Please note the weight of the item you are quoting exceeds the limits for Economy service. You can re-submit your quote using a lighter item.</br> If you can split the item into more boxes, you can quote each separately.</br> If this item is new, you can also check our Premium or Caixa Rapida service.</br>’;
    $continueeconomycalculation = ‘No’;
    $mailyesno = ‘No’;
    }
    //weight limiter gs – exit marker
    if (($lborkgorozorg == “Gs”) && ($weightqty > 29937)){
    $economyerrorresponse= ‘Please note the weight of the item you are quoting exceeds the limits for Economy service. You can re-submit your quote using a lighter item.</br> If you can split the item into more boxes, you can quote each separately.</br> If this item is new, you can also check our Premium or Caixa Rapida service.</br>’;
    $continueeconomycalculation = ‘No’;
    $mailyesno = ‘No’;
    }
    //convert weight into lbs
    if ($lborkgorozorg == “Lbs”){
    $finalweightinlb = $weightqty;
    }
    elseif ($lborkgorozorg == “Kgs”){
    $finalweightinlb = ($weightqty * 2.2);
    }
    elseif ($lborkgorozorg == “Oz”){
    $finalweightinlb = ($weightqty * 0.0625);
    }
    elseif ($lborkgorozorg == “Kgs”){
    $finalweightinlb = ($weightqty * 0.0022);
    }
    //normal girth – pricing calculation for lbs and in
    if (((($lborkgorozorg == “Lbs”) && ($inorcm == “In”) && ($totalgirthin <= 79)) || (($lborkgorozorg == “Lbs”) && ($inorcm == “Cm”) && ($totalgirthcm <= 195)) || (($lborkgorozorg == “Kgs”) && ($inorcm == “In”) && ($totalgirthin <= 79)) || (($lborkgorozorg == “Kgs”) && ($inorcm == “Cm”) && ($totalgirthcm <= 195)) || (($lborkgorozorg == “Oz”) && ($inorcm == “In”) && ($totalgirthin <= 79)) || (($lborkgorozorg == “Oz”) && ($inorcm == “Cm”) && ($totalgirthcm <= 195)) || (($lborkgorozorg == “Gs”) && ($inorcm == “In”) && ($totalgirthin <= 79)) || (($lborkgorozorg == “Gs”) && ($inorcm == “Cm”) && ($totalgirthcm <= 195))) && ($continueeconomycalculation != ‘No’)){
    $mailyesno = ‘Yes’;
    if (($finalweightinlb >= 0) && ($finalweightinlb <= 1)) {
    $economyfreighttotal = 50.65; //price up to 1lb
    }
    elseif (($finalweightinlb > 1) && ($finalweightinlb <= 2)) {
    $economyfreighttotal = 52.51; //price up to 2lb
    }
    elseif (($finalweightinlb > 2) && ($finalweightinlb <= 3)) {
    $economyfreighttotal = 55.47; //price up to 3lb
    }
    elseif (($finalweightinlb > 3) && ($finalweightinlb <= 4)) {
    $economyfreighttotal = 58.43; //price up to 4lb
    }
    elseif (($finalweightinlb > 4) && ($finalweightinlb <= 5)) {
    $economyfreighttotal = 61.39; //price up to 5lb
    }
    elseif (($finalweightinlb > 5) && ($finalweightinlb <= 6)) {
    $economyfreighttotal = 63.21; //price up to 6lb
    }
    elseif (($finalweightinlb > 6) && ($finalweightinlb <= 7)) {
    $economyfreighttotal = 66.01; //price up to 7lb
    }
    elseif (($finalweightinlb > 7) && ($finalweightinlb <= 8)) {
    $economyfreighttotal = 68.82; //price up to 8lb
    }
    elseif (($finalweightinlb > 8) && ($finalweightinlb <= 9)) {
    $economyfreighttotal = 71.63; //price up to 9lb
    }
    elseif (($finalweightinlb > 9) && ($finalweightinlb <= 10)) {
    $economyfreighttotal = 74.43; //price up to 10lb
    }
    elseif (($finalweightinlb > 10) && ($finalweightinlb <= 11)) {
    $economyfreighttotal = 77.70; //price up to 11lb
    }
    elseif (($finalweightinlb > 11) && ($finalweightinlb <= 12)) {
    $economyfreighttotal = 80.96; //price up to 12lb
    }
    elseif (($finalweightinlb > 12) && ($finalweightinlb <= 13)) {
    $economyfreighttotal = 84.23; //price up to 13lb
    }
    elseif (($finalweightinlb > 13) && ($finalweightinlb <= 14)) {
    $economyfreighttotal = 87.50; //price up to 14lb
    }
    elseif (($finalweightinlb > 14) && ($finalweightinlb <= 15)) {
    $economyfreighttotal = 90.76; //price up to 15lb
    }
    elseif (($finalweightinlb > 15) && ($finalweightinlb <= 16)) {
    $economyfreighttotal = 94.03; //price up to 16lb
    }
    elseif (($finalweightinlb > 16) && ($finalweightinlb <= 17)) {
    $economyfreighttotal = 97.10; //price up to 17lb
    }
    elseif (($finalweightinlb > 17) && ($finalweightinlb <= 18)) {
    $economyfreighttotal = 100.96; //price up to 18lb
    }
    elseif (($finalweightinlb > 18) && ($finalweightinlb <= 19)) {
    $economyfreighttotal = 104.82; //price up to 19lb
    }
    elseif (($finalweightinlb > 19) && ($finalweightinlb <= 20)) {
    $economyfreighttotal = 108.67; //price up to 20lb
    }
    elseif (($finalweightinlb > 20) && ($finalweightinlb <= 21)) {
    $economyfreighttotal = 111.30; //price up to 21lb
    }
    elseif (($finalweightinlb > 21) && ($finalweightinlb <= 22)) {
    $economyfreighttotal = 115.11; //price up to 22lb
    }
    elseif (($finalweightinlb > 22) && ($finalweightinlb <= 23)) {
    $economyfreighttotal = 118.92; //price up to 23lb
    }
    elseif (($finalweightinlb > 23) && ($finalweightinlb <= 24)) {
    $economyfreighttotal = 122.73; //price up to 24lb
    }
    elseif (($finalweightinlb > 24) && ($finalweightinlb <= 25)) {
    $economyfreighttotal = 126.54; //price up to 25lb
    }
    elseif (($finalweightinlb > 25) && ($finalweightinlb <= 26)) {
    $economyfreighttotal = 130.35; //price up to 26lb
    }
    elseif (($finalweightinlb > 26) && ($finalweightinlb <= 27)) {
    $economyfreighttotal = 134.17; //price up to 27lb
    }
    elseif (($finalweightinlb > 27) && ($finalweightinlb <= 28)) {
    $economyfreighttotal = 137.99; //price up to 28lb
    }
    elseif (($finalweightinlb > 28) && ($finalweightinlb <= 29)) {
    $economyfreighttotal = 141.80; //price up to 29lb
    }
    elseif (($finalweightinlb > 29) && ($finalweightinlb <= 30)) {
    $economyfreighttotal = 145.61; //price up to 30lb
    }
    elseif (($finalweightinlb > 30) && ($finalweightinlb <= 31)) {
    $economyfreighttotal = 149.42; //price up to 31lb
    }
    elseif (($finalweightinlb > 31) && ($finalweightinlb <= 32)) {
    $economyfreighttotal = 153.23; //price up to 32lb
    }
    elseif (($finalweightinlb > 32) && ($finalweightinlb <= 33)) {
    $economyfreighttotal = 157.05; //price up to 33lb
    }
    elseif (($finalweightinlb > 33) && ($finalweightinlb <= 34)) {
    $economyfreighttotal = 160.86; //price up to 34lb
    }
    elseif (($finalweightinlb > 34) && ($finalweightinlb <= 35)) {
    $economyfreighttotal = 164.67; //price up to 35lb
    }
    elseif (($finalweightinlb > 35) && ($finalweightinlb <= 36)) {
    $economyfreighttotal = 168.48; //price up to 36lb
    }
    elseif (($finalweightinlb > 36) && ($finalweightinlb <= 37)) {
    $economyfreighttotal = 172.29; //price up to 37lb
    }
    elseif (($finalweightinlb > 37) && ($finalweightinlb <= 38)) {
    $economyfreighttotal = 176.10; //price up to 38lb
    }
    elseif (($finalweightinlb > 38) && ($finalweightinlb <= 39)) {
    $economyfreighttotal = 179.91; //price up to 39lb
    }
    elseif (($finalweightinlb > 39) && ($finalweightinlb <= 40)) {
    $economyfreighttotal = 183.73; //price up to 40lb
    }
    elseif (($finalweightinlb > 40) && ($finalweightinlb <= 41)) {
    $economyfreighttotal = 187.54; //price up to 41lb
    }
    elseif (($finalweightinlb > 41) && ($finalweightinlb <= 42)) {
    $economyfreighttotal = 191.35; //price up to 42lb
    }
    elseif (($finalweightinlb > 42) && ($finalweightinlb <= 43)) {
    $economyfreighttotal = 195.16; //price up to 43lb
    }
    elseif (($finalweightinlb > 43) && ($finalweightinlb <= 44)) {
    $economyfreighttotal = 198.97; //price up to 44lb
    }
    elseif (($finalweightinlb > 44) && ($finalweightinlb <= 45)) {
    $economyfreighttotal = 202.78; //price up to 45lb
    }
    elseif (($finalweightinlb > 45) && ($finalweightinlb <= 46)) {
    $economyfreighttotal = 206.59; //price up to 46lb
    }
    elseif (($finalweightinlb > 46) && ($finalweightinlb <= 47)) {
    $economyfreighttotal = 210.41; //price up to 47lb
    }
    elseif (($finalweightinlb > 47) && ($finalweightinlb <= 48)) {
    $economyfreighttotal = 214.23; //price up to 48lb
    }
    elseif (($finalweightinlb > 48) && ($finalweightinlb <= 49)) {
    $economyfreighttotal = 218.04; //price up to 49lb
    }
    elseif (($finalweightinlb > 49) && ($finalweightinlb <= 50)) {
    $economyfreighttotal = 221.85; //price up to 50lb
    }
    elseif (($finalweightinlb > 50) && ($finalweightinlb <= 51)) {
    $economyfreighttotal = 225.66; //price up to 51lb
    }
    elseif (($finalweightinlb > 51) && ($finalweightinlb <= 52)) {
    $economyfreighttotal = 229.47; //price up to 52lb
    }
    elseif (($finalweightinlb > 52) && ($finalweightinlb <= 53)) {
    $economyfreighttotal = 233.29; //price up to 53lb
    }
    elseif (($finalweightinlb > 53) && ($finalweightinlb <= 54)) {
    $economyfreighttotal = 237.10; //price up to 54lb
    }
    elseif (($finalweightinlb > 54) && ($finalweightinlb <= 55)) {
    $economyfreighttotal = 240.91; //price up to 55lb
    }
    elseif (($finalweightinlb > 55) && ($finalweightinlb <= 56)) {
    $economyfreighttotal = 244.72; //price up to 56lb
    }
    elseif (($finalweightinlb > 56) && ($finalweightinlb <= 57)) {
    $economyfreighttotal = 248.53; //price up to 57lb
    }
    elseif (($finalweightinlb > 57) && ($finalweightinlb <= 58)) {
    $economyfreighttotal = 252.34; //price up to 58lb
    }
    elseif (($finalweightinlb > 58) && ($finalweightinlb <= 59)) {
    $economyfreighttotal = 256.15; //price up to 59lb
    }
    elseif (($finalweightinlb > 59) && ($finalweightinlb <= 60)) {
    $economyfreighttotal = 259.97; //price up to 60lb
    }
    elseif (($finalweightinlb > 60) && ($finalweightinlb <= 61)) {
    $economyfreighttotal = 263.78; //price up to 61lb
    }
    elseif (($finalweightinlb > 61) && ($finalweightinlb <= 62)) {
    $economyfreighttotal = 267.59; //price up to 62lb
    }
    elseif (($finalweightinlb > 62) && ($finalweightinlb <= 63)) {
    $economyfreighttotal = 271.40; //price up to 63lb
    }
    elseif (($finalweightinlb > 63) && ($finalweightinlb <= 64)) {
    $economyfreighttotal = 275.40; //price up to 64lb
    }
    elseif (($finalweightinlb > 64) && ($finalweightinlb <= 65)) {
    $economyfreighttotal = 279.02; //price up to 65lb
    }
    elseif (($finalweightinlb > 65) && ($finalweightinlb <= 66)) {
    $economyfreighttotal = 282.83; //price up to 66lb
    }}
    //Price calculation
    if ($continueeconomycalculation != ‘No’){
    $grandtotal = ($insurancetotal + $economyfreighttotal);
    echo ‘Cost of Insurance: ‘.number_format($insurancetotal,2).”</br>”;
    echo ‘Cost of Shipping: ‘.number_format($economyfreighttotal,2).”</br>”;
    echo ‘Total: ‘.number_format($grandtotal,2);
    }
    elseif ($continueeconomycalculation = ‘No’){
    echo $economyerrorresponse;
    }
    //Mail marker

    //Email summary
    //if ($mailyesno == ‘Yes’){
    //$messagecontent='<p>Hello ‘.$nameqty.’. You have quoted 1 piece with dimensions of ‘.$lengthqty.’ ‘.$inorcm.’ length x ‘.widthqty.’ ‘.$inorcm.’ width x ‘.$heightqty.’ ‘.$inorcm.’ height, with ‘.$weightqty.’ ‘.$lborkgorozorg.’.</br> Item with a value of $’.number_format($valueqty,2).’USD. </br> Shipping to: </br> ‘.$addressqty.’, ‘.$cityqty.’ ‘.$stateqty.’, Brazil, ‘.$zipcodeqty.’. </p><p> Estimated Shipping Costs: </br> Cost of Insurance: ‘.number_format($insurancetotal,2).'</br> Cost of Shipping: ‘.number_format($economyfreighttotal,2).'</br> Total: ‘.number_format($grandtotal,2).'</p>’;
    //$to = $emailqty;
    //$subject = ‘Economy Quote’;
    //$message=$messagecontent;
    //echo “<p> A copy of this summary has been sent to your Email.</p>”;
    //$from=”cotacao@brabox.com”;
    //$headers=”From: “.$from;
    //mail($to, $subject, $message, $headers);
    //}
    //if ($mailyesno == ‘No’){
    //echo $economyerrorresponse;
    //}
    ?>
    </body>
    </html>

    </code>

    Attachments:
    You must be logged in to view attached files.
    #6491
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #6533
    brabox
    Participant

    Hello Ally,

    Not sure i expressed correctly what i was trying to accomplish.

    I will try and explain again more detailed.

    I have created a form called Calc Eco EN, which i am using it as a shortcode [iphorm id=”19″ name=”Calc Eco EN”] into a wordpress page Eco Quote.

    I have set the Submit button in the form settings to Redirect to Page, where this page is a .PHP (with all my coding) that i have uploaded by FTP into my themes folder.

    I used all the Unique IDs from the quform in my PHP codes. (iphorm_19_1) etc..

    When i click submit, it redirects me to the PHP page fine, where it displays the code, but the values do not “get” the ones from the form, it just displays empty.

    Below is a small part of the begging of the PHP code where i used the Unique IDs from the form.


    $nameqty = $_POST ["iphorm_19_1"];
    $emailqty = $_POST ["iphorm_19_2"];
    $addressqty = $_POST ['iphorm_19_3'];
    $cityqty = $_POST ['iphorm_19_4'];

    The PHP was tested before with simple HTML, where the iphorm_19_1, 2, 3 etc.. were other values and it worked fine.

    please let me know if i have to add any other code into the PHP from to “retrieve” the values from the Qform. or, any other ideas.

    Thank you,
    Marco

    #6534
    brabox
    Participant

    I have also tried these 2 options with no luck…(not sure if they would help)

    Redirecting with form data

    Send form data to another script

    The 2nd option keeps giving me a “An error occurred submitting the form” error. I tried the Debug.log but nothing regarding that showed up.

    • This reply was modified 10 years, 7 months ago by brabox.
    #6536
    brabox
    Participant

    Ally,

    **Update**.

    It seems that i got it to work. (still going through some tests).

    All i did was to add Form Action before the Quform shortcode. Here is what i did below.

    <form action=”www.example.com/formcalculator.php” method=”post”>
    [iphorm id=”#_HERE” name=”IPHORM_NAME_HERE”]
    </form>

    Till now its working fine,

    Marco

    #6546
    brabox
    Participant

    Ally,

    So my current setup looks like this.

    Wordpress Calc page with this code inside:

    <form action=”www.example.com/formcalculator.php” method=”post”>
    [iphorm id="#_HERE" name="IPHORM_NAME_HERE"]
    </form>

    formcalculator.php with my code which has the Unique IDs etc..from the quform Calc.

    When i click send it works and all the data is being “read” into the formcalculator.php file.

    The only thing that is NOT working is that now i can simply click SEND even though the form has all elements as REQUIRED.

    Any ideas?

    #6548
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #6557
    brabox
    Participant

    Ally,

    Thank you for the link.

    I have tried that link as well as This onebefore several times with no luck… I cannot find what i am doing wrong.

    I saw that another user was able to accomplish this Here. But i could not get it to work.

    Is there any email i can send you the link so you can take a quick look? i am sure it is something “small” easy that i am missing….

    #6571
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #6588
    brabox
    Participant

    Thank you Ally,

    I have sent an email.

    #6615
    brabox
    Participant

    Thank you Ally, I received your email and it worked!!

    For anyone else trying to accomplish this, this is how i got it to work and my setup.

    In wordpress, i created 2 pages.

    1 – Page name (Calculator) = with the quform shortcode – [iphorm id=”22″ name=”Calc Eco EN”]
    2 – Page name (Resultpage) = I got my themes page.php and added my PHP code into the content area and saved it as a separate template (EXAMPLERESULT.PHP), then uploaded back via FTP to the child-themes folder. So when i created my 2nd page, I simply choose on the right hand side of wordpress (Template) my own template EXAMPLERESULT.PHP. (this link was also used on the URL of the PHP code below)

    In my child-themes-function I added Ally’s code which was on this link.

    // Code from Themecatcher for Calculator 1
    //

    function my_form_redirect($url, $form)
    {
    $data = array(
    'nameqty' => $form->getValue('iphorm_22_1'),
    'lnameqty' => $form->getValue('iphorm_22_23'),
    'emailqty' => $form->getValue('iphorm_22_2'),
    );

    $data = array_map('rawurlencode', $data);

    $url = add_query_arg($data, 'https://www.mysite.com/resultpage/');
    return $url;
    }
    add_action('iphorm_success_redirect_url_22', 'my_form_redirect', 10, 2);

    Now (only the begging of my PHP code) this is how my PHP code starts:

    //define variables and set to empty values
    $nameqty = $_GET ['nameqty'];
    $lnameqty = $_GET ['lnameqty'];
    $emailqty = $_GET ['emailqty'];

    So basically, $nameqty is getting [‘nameqty’] that is equal to iphorm_22_1. (each form will be different).

    Br,

    Marco

    #6639
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy