Create link with form data

Asked

Viewed 454 times

2

I have an external search site ready where the search results generate a link similar to this: http://example.com/pesquisa?utf8=✓&search=itempesquisado&x=0&y=0.

I would like to create a form on my site that leads to this external link, ie when the user type itempesquisado in the field and click submit should be directed to the page: http://example.com/pesquisa?utf8=✓&search=itempesquisado&x=0&y=0.

  • Try to put more details in your question, for example the html code of your form.

  • The problem is that if the source code is in a different server encoding, and/or the user uses a browser with another encoding when filling the form, it won’t do much to know how the . Better examine the headers and clarify in the parameters if you are using this data for encoding detection, and use entities ( utf8="ç" in the source code, for example. )

1 answer

2

Try this HTML code:

<html>
<body>
    <form method="get" action="http://endereco.com.br/pesquisa" enctype="application/x-www-form-urlencoded">
        <input type="hidden" name="utf8" value="✓">
        <input type="text" name="search" value="itempesquisado">
        <input type="hidden" name="x" value="0">
        <input type="hidden" name="y" value="0">
        <input type="submit" value="Pesquisar">
    </form>
<body>
</html>
  • You may have difficulty transmitting/receiving this symbol (%E2%9C%93), if you can change it, it will facilitate.
  • 2

    "You may have difficulty transmitting this symbol "But suddenly the idea is just to test on the server as the symbol was :)

  • Bacco, looking at the call I think the intention was just that. One thousand :D creativity.

  • @Anthonyaccioly I tried to deduce the logic, it seemed to me the only plausible reason :) in any case, see my comment on the question about the risk of not working as expected.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.