• Resolved wwcl87

    (@wwcl87)


    Hi,

    I’m stumped on this problem and I need some guidance. I have two forms: one called Test Form and another called Verification Form. In Test Form, users can enter a reference number (variable is your-reference). Based on the CFDB article on creating a form to search database (https://cfdbplugin.com/?page_id=680), I’ve modified it into the code below in CF7:

    <form action="" method="POST">
    Reference: <input type="text" name="your-reference" />
    <input type="hidden" name="x" value="1"/>
    <input type="submit" />
    </form>

    I copy the shortcode for Test Form onto the same page and then pasted the below shortcode to display the result, also based on the same article:

    [cfdb-table form="Verification Form" show="Reference_Number,Verification_Result,Brand,Model" filter="Reference_Number~~/.*$_POST(your-reference).*/i&&intval(1)=$_POST(x)&&submit_time>$_POST(x)"]

    So when I enter a reference number, nothing happens. What am I doing wrong? I’ve been stumped on this for hours!

    https://www.ads-software.com/plugins/contact-form-7-to-database-extension/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    It looks basically right.

    Make sure you don’t have any line breaks in it

    I don’t see how submit_time>$_POST(x) helps anything

    – Start with no filter, make sure it displays
    – Add filter=”Reference_Number~~/.*$_POST(your-reference).*/i” and make sure it displays
    – Test submit filters the results
    – Add on &&intval(1)=$_POST(x) and test the page starts a blank.

    You can add debug=”true” to get some information about how it parses the filter expressions

    Thread Starter wwcl87

    (@wwcl87)

    Thank you Michael, I removed the submit_time>$_POST(x) and went through the shortcode step-by-step again as you suggested and it worked!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Querying another database & display result’ is closed to new replies.