How do you pass a URL into a CodeIgniter controller? [duplicate]
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.
精彩评论