Jump to content

1eye

New Members
  • Content count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About 1eye

  • Rank
    Newbie
  1. I realized I hadn't set the form up correctly, after changing it to the following it now works. Thank for the advice much appreciated.
  2. After reading your reply i changed my code slightly but it still doesn't work. I'm trying to use admin_post hook but i must be doing something wrong. I've added some snippets below. The above image shows the hook and the inclusion of the file that contains the prefix_admin_add_foobar function. The following snippet shows the function but its not getting called. This is the form. When i submit the form I'm getting a 404 page not found error. Thanks.
  3. My bad, sorry for not being specific enough. I want the user to fill out the form then immediately be redirected to the new page. The user doesn't enter the specific id, this is a value saved to the wp_options table by the admin. The path I was providing for the php script was incorrect so when I submitted the form it could not find the php script used to validate the forms inputs and call the header function! Stupid of me I know. After putting in the correct path the next problem I face is getting access to the specific id. For the specific id, I created a menu page for the plugin with a settings section. Here the admin can enter an id which is saved to the wp_options table. When I try to access the id in the aforementioned php script I'm getting a; call to undefined function get_option() error. I know the specific id exists because I used database-browser to look it up. I also know the get_option() function exists in the options.php file in the wp-includes folder. I hope that gives you a clearer understanding of what I am trying to achieve and maybe an idea of what I am doing wrong.
  4. Hi all, I am trying to create a plugin that shows a simple form with a few input fields i.e. departure date, return date, number of adults etc. and based on these inputs load an external URL e.g. www.booking/Specific_Id/20-8-108/23-8-2018/2 . I have created the form and I have also created some settings on the admin side which contains the specific_id input, the problem is I don't know how to get the input values of the form and then load the specific URL. I tried to post the form to a PHP file and then use the header function to load the URL but it's not working for me. I would appreciate any help/advice you could give.
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.