GET variables with spaces - they work, but is it correct or ok?

前端 未结 3 536
臣服心动
臣服心动 2021-01-01 22:34

I have a PHP page where I\'m passing the city name via a \"city\" URL/GET variable. Currently, it\'s passing the actual city name even if it has spaces (eg .php?city=

3条回答
  •  长情又很酷
    2021-01-01 23:16

    Space in URL is fine. One thing you need to take note is whenever working with variable taken from outside your control (URL variable, Cookies, etc, etc). Always remember to clean it up to prevent sql injection, XSS, and other malicious attack.

提交回复
热议问题