开发者

How do you pass a URL into a CodeIgniter controller? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

url encoded forward slashes breaking my codeigniter app

This is my controller:

class Foo extends Controller
{
   public function bar($url) {
       echo 'hello world';
   }
}

If I pass in a normal string into the bar function, I see "hello world" printed out.

http://website.com/index.php/foo/bar/argument

If I pass in a URL encoded string into the bar function, I get an error.

http://website.com/index.php/foo/bar/http%3A%2F%2Fwww.yahoo.com

.

开发者_如何转开发

Not Found

The requested URL /index.php/foo/bar/http://www.yahoo.com was not found on this server.


use base64_encode() and base64_decode() to encode/decode the url, but you may need to add more character in your permitted uri config.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜