?
Solved

Using wordpress shortcode to process form values

Posted on 2012-08-28
5
Medium Priority
?
544 Views
Last Modified: 2012-09-19
I am currently developing shortcode to display a list of items on a page.  There is a form with a series of listboxes for a user to filter the list that appears.  Here is my problem, whenever I check for the values of the "$_POST" variables there are always empty.  Does wordpress have some utility that intercepts the form values before they make it to the shortcode.  The strange thing is that if I go to the page directly and pass the value along the querystring and change from $_POST to $_GET it works.  This is very confusing.  Any help would be greatly appreciated.
0
Comment
Question by:rawcoder
  • 3
  • 2
5 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 38342943
Try changing your code from $_POST to $_ REQUEST and see if it works better.
0
 

Author Comment

by:rawcoder
ID: 38342991
Still not working.  Could it be a timing issue?
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 1500 total points
ID: 38343028
Unlikely, but it could be a redirect issue.  If the form posts and then redirects, the $_POST would be empty on the resulting page.

There could also be a plugin that is resetting $_POST on init.  Try disabling all plugins and test again.
0
 

Author Comment

by:rawcoder
ID: 38343229
Disabling all plugins did not work.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 38343376
Did you check to see if a redirect is present?  Use Firebug or similar to see what happens as you submit a form.  If there is a 301 or 302 at any point after submission, the $_POST array is useless.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question