des1roer
@des1roer
ученье - свет, а неученье - приятный полумрак

Как пост запросом передать +?

вопрос наверно странный - хочу передать через аякс запрос строку для постгреса примерно такого вида 'where time < now() + interval 1 day'
в теле запроса + просто затирается. как его заэкранировать?
  • Вопрос задан
  • 209 просмотров
Решения вопроса 1
DevMan
@DevMan
офигенно: отправляешь запрос аяксом, а тег у вопроса PHP.
добавь еще MySql, не стесняйся.

www.w3schools.com/jsref/jsref_encodeuricomponent.asp и декодинг на стороне php.
When data that has been entered into HTML forms is submitted, the form field names and values are encoded and sent to the server in an HTTP request message using method GET or POST, or, historically, via email. The encoding used by default is based on a very early version of the general URI percent-encoding rules, with a number of modifications such as newline normalization and replacing spaces with "+" instead of "%20". The MIME type of data encoded this way is application/x-www-form-urlencoded, and it is currently defined (still in a very outdated manner) in the HTML and XForms specifications.
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы