Problems with email form and contact form

WordPress theme dedicated to start-up websites with amazing CSS3 animated icons, price tables and parallax effect background.
GK User
Tue May 07, 2013 10:34 pm
Hi,
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.
User avatar
Fresh Boarder

GK User
Wed May 08, 2013 7:06 am
The file You are trying to address is not in root of wordpress installation, but in /wp-content/themes/theme-name-(child)/

If You would like to get current theme path, use:
Code: Select all
<?php echo get_template_directory_uri(); ?>

for parent theme path or:
Code: Select all
<?php echo get_stylesheet_directory_uri(); ?>

for child theme patch.

Also check those resources for more info:
http://codex.wordpress.org/Function_Ref ... ectory_uri
http://codex.wordpress.org/Function_Ref ... ectory_uri
User avatar
Moderator


cron