We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Can I post / send form data to a plugin?

Development and Programming

dsloan's avatar
dsloan
48 posts
15 years ago
dsloan's avatar dsloan

Hi, we have developed a plugin which accesses a hosted application on a separate server via an API call, and returns search results. However, at the moment it just accepts the search parameters via the tag parameters - see below for a simplified version with just one search parameter.

{exp:rentpro:search town_id='123'}
    <strong>ID {property_id}:</strong> {address1}<br>
{/exp:rentpro:search}

I need to be able to get these results showing in response to someone submitting a search form, which will have been previously populated with town IDs from a previous API call. Any ideas how / if this can be done?

Thanks, Diarmid

       
dsloan's avatar
dsloan
48 posts
15 years ago
dsloan's avatar dsloan

Anyone any advice or experience of this? It’s basically like a normal application’s form submit, which will return results for display. Except in this case the form in the template needs that submit action to retrieve results from an API (via the plugin) and then display the results on the subsequent screen. Not sure if I’m missing something obvious.

Appreciate any pointers… Thanks, Diarmid

       
Rob Sanchez's avatar
Rob Sanchez
335 posts
15 years ago
Rob Sanchez's avatar Rob Sanchez

You could do something like this:

{exp:rentpro:search town_id='POST'}
    <strong>ID {property_id}:</strong> {address1}<br>
{/exp:rentpro:search}
function search()
{
    global $IN, $TMPL;

    $town_id = $TMPL->fetch_param('town_id');

    if ($town_id == 'POST')
    {
        $town_id = $IN->GBL('town_id', 'POST');
    }
}
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.