• Resolved TheDailyCrowdsource

    (@thedailycrowdsource)


    Hi,

    Is there a way to use some PHP to get the values of one record (1 form submission)?

    In my admin screen, I’ve created a plugin that I want to display the contents of 1 form, so my writers can see info on a suggested article. ie:

    Title: <form_title>
    Details: <form_details>

    I’m displaying the data in a WP thickbox, & the shortcodes don’t work. Rather than reinvent the wheel & grab the form submissions myself, I was hoping there might already be some code in place. Any suggestions?

    Thanks!

    -David

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

    (@msimpson)

    You would have to jump through some hoops. I haven’t tried this yet but I would got about it like this:

    From the plugin directory, include the file ExportToJson.php (and you probably will find you need to include a few other files for it to work directly like CF7DBPlugin.php, CF7FilterParser.php and DereferenceShortcodeVars.php) and do something like this:

    $exporter = new ExportToJson;
    $exporter->export(
        'your-form-name',
        array('html' => true, 'var' => 'myrow', 'filter' => 'field_name=value'));

    That will output a <script> tag with Javascript setting variable myrow = json like what is described in the FAQ. You then need to write some Javascript to pull that data out of that var and put it where you want it on your page.

    Thread Starter TheDailyCrowdsource

    (@thedailycrowdsource)

    Thanks! I got it working. Appreciate your help & love the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Contact Form 7 to Database Extension] Extract 1 row using php (not shortcode)?’ is closed to new replies.