Here’s how I want things to work:
- User submits form successfully.
- User’s name and email get added to mailing list, if they have ticked a box.
I have looked into the CF7 Database plug-in, but that only saves to the WordPress database, and I need the values saved to another database which already runs our newsletter. So I need to run some PHP code when CF7 successfully sends the email. As far as I can tell there’s no way to attach the code to the form itself, so the only way would be to redirect to a page that does this…but then I would have to pass the form variables onto the “thank you” script that adds them to the database.
So I guess there could be three solutions to this issue:
- A plug-in that takes CF7 input and saves selected fields to a database and table that the admin selects, or
- a way to set form-specific PHP to be executed upon a successful send, or
- a way to pass on CF7 form values to a page being redirected to, so that it can perform the same thing.
I appreciate any help!
- The topic ‘Running PHP code on success, passing variables’ is closed to new replies.