Title: Custom front-end form
Last modified: August 21, 2016

---

# Custom front-end form

 *  Resolved [writegnj](https://wordpress.org/support/users/writegnj/)
 * (@writegnj)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/custom-front-end-form/)
 * I made custom front-end form and storing all data to wp_posts,
    wp_em_events 
   and wp_em_locations. I checked all the data stored in those three tables but 
   it does not show up in backend under Events.
 * Does anyone have any idea what is going on with this? Am I missing a table that
   needed to updated to make it show up under Events?
 * in front-end tho, the event title shows up but it goes to 404 page when I click
   on it. However, it has correct URL.
 * this thread marked as solved but I don’t see the solution.
    [https://wordpress.org/support/topic/events-manager-database?replies=9](https://wordpress.org/support/topic/events-manager-database?replies=9)
 * [https://wordpress.org/plugins/events-manager/](https://wordpress.org/plugins/events-manager/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [angelo_nwl](https://wordpress.org/support/users/angelo_nwl/)
 * (@angelo_nwl)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/custom-front-end-form/#post-4611825)
 * hi,
 * sorry, can I know what customization you did for us to make a suggestion ?
 *  Thread Starter [writegnj](https://wordpress.org/support/users/writegnj/)
 * (@writegnj)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/custom-front-end-form/#post-4611832)
 * I got custom front-end form and trying to save event data from it in functions.
   php with action hook.
 *     ```
       global $wpdb;
           $wpdb->insert( $wpdb->prefix . 'em_locations',
       		array(
       				'post_id'			=> $post_id,
       				'blog_id'			=> $blog_id,
       				'location_slug'		=> $location_slug,
       				'location_name'		=> $_POST['cf_location_name'],
       				'location_owner'	=> $current_user->ID,
       				'location_address' 	=> $fullstreet,
       				'location_town'		=> $_POST['cf_location_city'],
       				'location_state'	=> $_POST['cf_location_state'],
       				'location_postcode'	=> $_POST['cf_location_zipcode'],
       				//'location_country'	=> $_POST['cf_location_country'],
       				'location_country'	=> 'US',
       				'location_latitude'	=> $_POST['cf_location_lat'],
       				'location_longitude'=> $_POST['cf_location_lng'],
       				'location_status'	=> '1'
       			)
       		);
   
           $wpdb->insert( $wpdb->prefix . 'em_events',
       		array(
       				'post_id'				=> $post_id,
       				'blog_id'				=> $blog_id,
       				'event_slug'			=> $event_slug,
       				'event_owner'			=> $current_user->ID,
       				'event_status'			=> '0',
       				'event_name'			=>	$_POST['wpuf_post_title'],
       				'event_start_time'		=> $event_st,
       				'event_end_time'		=> $event_et,
       				'event_all_day'			=> '0',
       				'event_start_date'		=> $_POST['cf_date_start'],
       				'event_end_date'		=> $_POST['cf_date_to'],
       				'post_content'			=> $_POST['wpuf_post_content'],
       				'location_id'			=> $EM_Location->id,
       				'event_category_id'		=> $_POST['cf_event_category'],
       				'event_date_created'	=> $post_date,
       				'event_date_modified'	=> $post_modified
       			)
       		);
       }
       ```
   
 * After submitting the form I saw data stored in Database but it goes to 404 page
   on front-end.
 *  [Philip John](https://wordpress.org/support/users/philipjohn/)
 * (@philipjohn)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/custom-front-end-form/#post-4611866)
 * Hiya,
 * EM is a complex plugin that does a LOT of work in addition to storing post types.
 * The method you’ve used isn’t available even for normal posts. You should be using
   the functions made available for inserting posts, not making database calls directly.
 * See [http://wp-events-plugin.com/documentation/advanced-usage/](http://wp-events-plugin.com/documentation/advanced-usage/)
   for some of the methods available to EM.
 * Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Custom front-end form’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=1039078)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Philip John](https://wordpress.org/support/users/philipjohn/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/custom-front-end-form/#post-4611866)
 * Status: resolved