URL form sending nomenclature

Asked

Viewed 128 times

0

Sending a form the result of the sent url is this:

search.php? checkin=22%2F12%2F2017&checkout=10%2F01%2F2018

I’d like to keep it that way:

search.php? checkin=16/08/2017&checkout=25/08/2017

In your opinion, what is the best way to do?

2 answers

0

There is no "best way" because this is already the correct format.

This is called "encoded url".

In the backend, PHP for example, decode with the function urldecode() if necessary.

-1

In Standard Resource Finder (URL, Uniform Resource Locator), an internet address the percent encoding is used to prevent misinterpretation of special characters such as spaces, parentheses and other symbols. The web browser analyzes the location address and encodes/decodes the special characters so that everything works properly.

The use of percent encoding is required in the case of non-printable characters, characters outside the ASCII standard, characters reserved to the syntax of a URL ("$", "&", "+", ",", "/", ":", ";", "=", "?", "@") and unsafe characters that can fool a URL (espaço, "<", ">", "#", "%", "{", "}", "|", "\", "^", "~", "[", "]", "").`

Escape character table in URL:

Caractere    Codificação     Caractere     Codificação

espaço          %20             #             %23
$               %24             %             %25
&           %26             @             %40
`               %60             /             %2F
:               %3A             ;             %3B
<            %3C             =             %3D
>            %3E             ?             %3F
[               %5B             \             %5C
]               %5D             ^             %5E
{               %7B             |             %7C
}               %7D             ~             %7E
+               %2B             ,             %2C

Source: http://dan-scientia.blogspot.com.br/2010/05/codificacao-por-cento-para-caracteres.html

Browser other questions tagged

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