WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Insert user data and form entries to custom table (4 posts)

  1. AA-ron
    Member
    Posted 1 year ago #

    For registered, logged-in users on my site:

    I would like to create a form that allows the user to enter text in four fields.

    When the registered, logged-in user hits submit:

    I would like to insert a record into a custom table.

    The table would have six columns: user_email, umeta_id #3 (nickname) meta_value, form field1, form field2, form field3, form field4.

    So, the submit function would get the logged-in user's email and nickname, and then insert those and the four form response fields into the table.

    How am I going to do that?

  2. AA-ron
    Member
    Posted 1 year ago #

    Thinking out loud here ...

    Would it actually be easier to have six spots on the form, and pre-fill the first two with existing data?

  3. AA-ron
    Member
    Posted 1 year ago #

    Actually, I only need one unique piece of user data, now that I think about it. I can run a custom report to fill in the other piece of data, instead of just dumping the table. Less work on the php side, more work on the SQL side where I know more.

    And I could have the user enter the unique piece of data, even though it would be cooler if the site could fill that in. Maybe later when I'm better at coding.

    And I am also looking at using verify instead of access control. That would simplify while accomplishing the same thing if implemented correctly. People could fill out the form, but if they weren't registered members, it would keep running verify back.

    That way I don't have to restrict the page to members only to keep the form from getting spammed.

  4. AA-ron
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic