WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form DB
Calculation with values (2 posts)

  1. andaluzo
    Member
    Posted 1 year ago #

    Hi,

    I try to accomplish the following task,

    Save the values of a form to the database.
    f.ex. A=2 , B=4 etc
    after saving the values to the database, and redirecting to a second page with on_sent_ok: "location.replace('/some-url/');" , calculate on the second page the result of f.ex. A+B.

    But how i get always the result for that specific user, is there a possibility for an Session ID?

    An Ideas how to accomplish this task.

    Thanks a lot

    http://wordpress.org/extend/plugins/contact-form-7-to-database-extension/

  2. Michael Simpson
    Member
    Plugin Author

    Posted 1 year ago #

    There is no easy way to do this because the plugin that creates the form and forwards to the next page is unaware of the plugin that is saving the data to the DB. When the form submission is saved, it gets a submit_time unique ID, but there is no way to feed that back to the browser.

    But the plugin will also save Cookie information. Go to the Database Options administration page and be sure "Save Cookie Data with Form Submissions" = "true"
    If you then have session information in the cookie you might be able to match that up on the second page as a parameter into the short code (see Cookie info this page)

    Also: If a user is logged-in when he submits his form, then his user name will be captured in the form data in the DB.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic