Support » Fixing WordPress » How to shorten url from form (method="get")?

  • Hi!

    I’ve created a form on my website which acts like a search engine for my dictionary. Everything’s ok until I start using all these options for advanced search and URL (which contains all the data necessary for the mysql query) starts looking something like this:

    Not only this is impractical, but I’d rather visitors didn’t have to see all that data in the URL.

    I’ve written this code in a page template and omitted the action attribute as it would otherwise redirect me to my homepage.

    Is there a way I could continue using method get, but make it invisible for the visitors (or encode it)?

Viewing 4 replies - 1 through 4 (of 4 total)
  • you could encode it yourself into a simple string. with a little php code..

    it would be like

    let me find a code for you. and then the website would look at the query and decode it 🙂


    put the $query in the url path on form get..

    then get it to decode it back after…

    with a simple chunk split i think..

    $newquery = md5($newstr);

    $explodethis = explode(“,”, $newquery);

    echo $explodethis[0]; // qry1
    echo $explodethis[1]; // qry2
    echo $explodethis[2]; // qry3

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to shorten url from form (method="get")?’ is closed to new replies.