Welcome Guest, Not a member yet? Register   Sign In
URL help
#4

[eluser]Pascal Kriete[/eluser]
The problem is caused by the escaped slashes. Using escape() or encodeURI() works, but then you're left with the slashes - meaning segment(3) will simply be "http:".

The best solution I can come up with is to replace the slashes with something that most urls don't have, such as:
Code:
location.href='http://localhost/test/addbookmark/'+location.href.replace(/\//g, "__myseperator__");

That will replace all the '/' with '__myseperator__'.

Then in your controller you could replace them again to reassemble your link:
Code:
$encoded_url = $this->uri->segment(3);
$url = str_replace('__myseperator', '/');

There is probably a prettier way, but this works (as long as none of your bookmarks have __myseperator__ in them Wink).


Messages In This Thread
URL help - by El Forum - 01-02-2008, 01:23 PM
URL help - by El Forum - 01-02-2008, 01:51 PM
URL help - by El Forum - 01-07-2008, 09:21 AM
URL help - by El Forum - 01-07-2008, 02:13 PM
URL help - by El Forum - 02-13-2008, 07:24 PM
URL help - by El Forum - 06-03-2008, 07:18 AM
URL help - by El Forum - 06-03-2008, 08:31 AM
URL help - by El Forum - 06-03-2008, 08:42 AM
URL help - by El Forum - 06-03-2008, 09:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB