a challenging problem

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

a challenging problem

huajun qi
I want to post some data including url such as:"url=www.google.com?query=123$t=now", I my controller, what i need to do to get right url parameter?

If I want to post many urls ,such as a.html, b.html, c.html, which way is best to post them?

Now i json_cncode a url array to a string ,then encodeURIcomponent the str and post it, but in my controller, I can not get the right string, i have to stripslashed it to get the right string. Does zend support decodeURIcomponent?

--
Location:
Reply | Threaded
Open this post in threaded view
|

Re: a challenging problem

umpirsky
Why not use PHP functions urldecode and urlencode?

Regards,
Saša Stamenković


On Tue, Nov 17, 2009 at 2:58 PM, huajun qi <[hidden email]> wrote:
I want to post some data including url such as:"url=www.google.com?query=123$t=now", I my controller, what i need to do to get right url parameter?

If I want to post many urls ,such as a.html, b.html, c.html, which way is best to post them?

Now i json_cncode a url array to a string ,then encodeURIcomponent the str and post it, but in my controller, I can not get the right string, i have to stripslashed it to get the right string. Does zend support decodeURIcomponent?

--
Location:

Reply | Threaded
Open this post in threaded view
|

Re: a challenging problem

huajun qi
cawa, I did try it. But it did not work!

It is not identical to js method encodeURIcomponent. 

2009/11/17 Саша Стаменковић <[hidden email]>
Why not use PHP functions urldecode and urlencode?

Regards,
Saša Stamenković



On Tue, Nov 17, 2009 at 2:58 PM, huajun qi <[hidden email]> wrote:
I want to post some data including url such as:"url=www.google.com?query=123$t=now", I my controller, what i need to do to get right url parameter?

If I want to post many urls ,such as a.html, b.html, c.html, which way is best to post them?

Now i json_cncode a url array to a string ,then encodeURIcomponent the str and post it, but in my controller, I can not get the right string, i have to stripslashed it to get the right string. Does zend support decodeURIcomponent?

--
Location:




--
Location:
Reply | Threaded
Open this post in threaded view
|

Re: a challenging problem

Matthew Ratzloff
In reply to this post by huajun qi
I found plenty of results by doing a simple Google search: http://tinyurl.com/yz78qmq

If you need to do multiple URLs, name them url[] and access them like an array on the PHP side.

-Matt

p.s. This isn't a Zend Framework question.

On Tue, Nov 17, 2009 at 5:58 AM, huajun qi <[hidden email]> wrote:
I want to post some data including url such as:"url=www.google.com?query=123$t=now", I my controller, what i need to do to get right url parameter?

If I want to post many urls ,such as a.html, b.html, c.html, which way is best to post them?

Now i json_cncode a url array to a string ,then encodeURIcomponent the str and post it, but in my controller, I can not get the right string, i have to stripslashed it to get the right string. Does zend support decodeURIcomponent?

--
Location: