Support » Fixing WordPress » Form submission and page update in Custom Page

  • Ok, I need some direction here.
    I have a WordPress site and I have created a Custom Page called Games.
    It uses PHP to get a list of games from my database.
    Now, the functionality I need to add is basic form submission and data retrieval.
    For example you get a choice of Xbox, PS3, and Wii in a drop down. You select an option and clicks submit.
    The page will need to process the query and update with the results.
    Now, I know how to do this with php and form processing OUTSIDE of wordpress. I’d call myself and use the vars passed in the POST and retrieve what I need.
    However, any one have any ideas how I can incorporate this functionality INSIDE my custom page on wordpress?

    Thanks!

Viewing 1 replies (of 1 total)
  • You have two issues – You need a place to put your code. The two best places are in a plugin you create or in the functions.php file of your theme.

    There is an excellent new book “Professional WordPress Plugin Development” that will quickly walk you through process.

    Then you need to write a PHP function to process the form submission. If you take a look at /wp-admin/admin-post.php – that is the best place to hook a post from a form into WordPress. You can setup a custom input called “action” and use add_action based on that action to your code which can catch the values in your POST.

Viewing 1 replies (of 1 total)
  • The topic ‘Form submission and page update in Custom Page’ is closed to new replies.