I am not able to capture emails entered into the default email contact form on the homepage, nor am I able to capture information entered into the default contact page. Does data from these forms get saved into the wordpress database by default somewhere, and if so, what table is it saved under?
It didn't look like the data is saved into the wordpress database, so I went ahead and wrote a php file and also created a table in the wp database and also modified the form to call on the php file. However, wordpress isn't recognizing the php file.
I placed the php file in the main directory of the child theme. Is this the right location for the php file or should it go somewhere else? Is there some action I need to take for wordpress to recognize the new php file?
Here is the error I'm seeing:
- Code: Select all
Not Found
The requested URL /gk_simplicity_quickstart_WP_3.5/email_notification.php was not found on this server.
Here is the html for the form
- Code: Select all
<form class="gk-form" action="email_notification.php" method="post">
<div><input type="email" name="em_notification" placeholder="Email address ..."> <input type="submit" value="Get SleepOn beta"></div>
</form>
and here is the php file I created
- Code: Select all
<?php
/*
Template Name: Email Notification
*/
?>
<?php
/**
*
* Custom file created by Allister to connect email form on homepage to email_notification table in the wp database
*
**/
global $wpdb;
global $tpl;
$field_email = $_POST['em_notification'];
$wpdb->insert( 'sim1_usr_email_notifications', array( 'sim1_usr_email_notificationscol' => $field_email ), array( '%s' ) );
?>
I've spent over 6 hours already trying to make this work, so I'm hoping you can help.