Passing Variables in Wordpress. Probably Simple but i r dumb

kingofsp

WF Premium Member
Mar 1, 2008
5,325
152
0
Los Angeles
Basically, this is what I'm trying to accomplish:

I have a form with multiple dropdowns and therefore multiple variables on one page, and when the user makes their selections and submits, I want to pass those variables on to another page that uses a script to pull results from a data feed using those variables. I have the script/datafeed set up, I just don't know how to tell it to use those variables.

What would be the best way to do this? Using something like search.php and modifying it?

Any help or pointing in the right direction would be greatly appreciated. I can offer offwhitehat link/handjob in return.

Also, Skype: offwhitehat

Thanks
 


If the form method is post, on the second page you can obtain the variables using the variable $_POST['variable_name']. Make sure you escape the data as you should never trust data from the users directly. See PHP: $_POST - Manual I added you on skype if you'd prefer to follow up in real time.
 
  • Like
Reactions: kingofsp
There's a wordpress plugin called "myvar" that you can use to pass parameters through the url.