在codeigniter中通过url传递大字符串

在codeigniter中通过url传递大字符串,codeigniter,uri,Codeigniter,Uri,如何在codeigniter中将大字符串作为变量传递?我尝试向用户显示一篇文章,如果文章超过800个字符,少于3044个字符,我将在jquery弹出窗口中显示,如果文章超过3044个字符,我希望通过url将文章正文和标题传递给控制器函数。 以下是我尝试过的: <?php if(strlen($home_content[1]['content'])>800 && strlen($home_content[1]['content'])<3044) { $s

如何在codeigniter中将大字符串作为变量传递?我尝试向用户显示一篇文章,如果文章超过800个字符,少于3044个字符,我将在jquery弹出窗口中显示,如果文章超过3044个字符,我希望通过url将文章正文和标题传递给控制器函数。 以下是我尝试过的:

<?php 
if(strlen($home_content[1]['content'])>800 && strlen($home_content[1]['content'])<3044)
{
    $substr=substr($home_content[1]['content'],0,786);
    echo $substr.'<p id="button"><a href="#"><i>read more...</i></a></p>';
}
else if(strlen($home_content[1]['content'])<800)
{
        echo $home_content[1]['content'];
}
else
{
    $substr=substr($home_content[1]['content'],0,786);
    echo $substr.'<br/>';
    echo anchor('site/read_article/'.$home_content[1]['title'].$home_content[1]['content'],'<i>read more...</i>');
}
?>

我如何正确地做它?url看起来很凌乱,如何传递字符串并且仍然有一个干净的url?请帮帮我。

为什么不传递文章ID呢?然后,您可以通过控制器功能访问文章,计算字符数并决定显示方法

或者,您可以使用CI的会话Flashdata将文章标题/正文传递给下一个控制器并以这种方式访问它


URI失败,因为安全设置为拒绝URL中传递的特定字符。这是为了保护您,但是,尽管不推荐,但如果需要,可以在配置文件中禁用。

最好使用Craig所说的,因为即使禁用了安全性,我们也会遇到大小限制问题
An Error Was Encountered

The URI you submitted has disallowed characters.