Get user input using plugin
-
This might be kind of long.
I have built a plugin that queries another sites api. I am using a shortcode to add my plugin to its own page, if that matters.
My problem is I want visitors to my blog to be able to input their own zip code to make the query with.
I’ve simplified my function the shortcode calls to include a form with a single input and the action set to the current url,
function shortcode_view(){
$display = '<form action= "'.$_SERVER['REQUEST_URI'].'"><input type="text" name="zip" value="012345" size="20">
<input type="submit" name="Submit" value="Update Options" /></form>';
return $display;
}
which looks like ‘wordpress/?page_id=3’ but obviously when I post to this form it gets processed by whatever catches ‘wordpress/’ which does nothing. So what am I missing?
The topic ‘Get user input using plugin’ is closed to new replies.