doulan9188 2012-09-10 17:43
浏览 68
已采纳

403 FORBIDDEN ajax调用脚本[复制]

Possible Duplicate:
JavaScript URL encode

some scripts working fine started to give me this error.

It is probably due to some special chars inside the string passed.

Ajax is calling this:

.../ControllerAjaxSpecifiche.php?Material=100%%20poliester&product=Maglia (trikot)

this way it says 403 forbidden error

removing the % and () it works

.../ControllerAjaxSpecifiche.php?Material=100%20poliester&product=Maglia trikot

How I can solve this problem?

I tried passing those variables as post, buit it did not works, and I continue having same problem.

  • 写回答

2条回答 默认 最新

  • dongshen7407 2012-09-10 17:47
    关注

    Try urlencode() (php) or encodeURI() encodeURIComponent() (js) before passing the values. This should escape any harmful characters

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?