Contact form 7 insert value into database
-
I have read and tried many forum topics about this subject, but I can retrieve the value of a form field.
This code works flawless, except it does not enter any value for the variable $emailadres
function wpcf7_modify_this(&$wpcf7_data) { global $wpdb; $DB_NAME = 'perspexocmsnl'; $DB_USER = 'perspexocmsn'; $DB_PASSWORD = 'xxxxxxx'; $DB_HOST = 'localhost'; $newdb = new wpdb($DB_USER, $DB_PASSWORD, $DB_NAME, $DB_HOST); $emailadres = $wpcf7_data->posted_data['your-email']; $newdb ->query("insert into px_mailinglist (emailadres) values ('$emailadres')"); } add_action("wpcf7_before_send_mail", "wpcf7_modify_this");I also tried the wpdb variant, but with the same result:
a row is inserted in the database but no value for the field emailadres is inserted.Is there anybody who can help me with this?
Thanks a lot.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Contact form 7 insert value into database’ is closed to new replies.