Escaping characters in URL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Big John
Forum Newbie
Posts: 3
Joined: Mon Mar 22, 2010 4:24 pm

Escaping characters in URL

Post by Big John »

I have the following form:

Code: Select all

              
<form action="?" method="get">
     <fieldset>
          <input type="text" name="keyword" />
          <input type="submit" value="Search" id="search" />
      </fieldset>
</form>
 
It's for searching images in a gallery.But when I enter for example 'äõ', since it sends it to the same page, I get the URL index.php?keyword=äõ. When I select the URL and hit enter, then the URL changes to index.php?keyword=%E4%F5.
I want it to be like index.php?keyword=%E4%F5 the first time I enter 'äõ' and click the search button.

Thanks.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Escaping characters in URL

Post by requinix »

That's how it works. Unless you want to use some JavaScript to submit the form the way you want, just live with it.
Alkis
Forum Commoner
Posts: 31
Joined: Fri Mar 26, 2010 8:41 am

Re: Escaping characters in URL

Post by Alkis »

you can actually change the method from "get" to "post" and nothing appears on the url.

And to get the variables, instead of using the $_GET superglobals, use $_POST ones.
Post Reply