That URL looks extremely unfriendly to me. I can understand urlencode
(), but why addslashes() as well?
This has been covered many, many, many times before. For friendly &
clean URLs use:
Inflector::slug($url, '-');
On Aug 12, 8:17 pm, joshua <[email protected]> wrote:
> I want to make a friendly url in my app.
> So assume the url likes following:
> [code]
> var $url = "what's the project name is?";
> [/code]
>
> Before I insert this url into database, I want to encode it firstly.
> [code]
> $url = urlencode(addslashes($url)); //$url
> ='what%26%23039%3Bs+the+project+name+is%3F'
> [/code]
>
> So in the post list view, the post link looks like:
> [url]http://www.example.com/posts/view/what%26%23039%3Bs+the+project+name+...
> [/url]
>
> But when I try to get the parameter in post controller, it print 'what', not
> the whole string('what%26%23039%3Bs+the+project+name+is%3F').
>
> PostsController:
> [code]
> function view($url){
> debug($url);// print out "what"}
>
> [/code]
> As you can see the strng after 'what' was cut off. Is there any way that I
> can get the whole parameter in post controller?
> Thanks in advance! :-]
>
> Joshua
> 5span.com <https://www.5span.com>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---