[英]Codeigniter - Base URL not working within the <a href=“”> tag
很抱歉这个愚蠢的问题。 我已经在stackoverflow上搜索了此问题,但无法获得确切问题的答案。
无论如何。
这是我的代码:
$pid = $this->encrypt->encode($pid_info);
$data_user = array('first_name' => $first_name,
'delete' => " <a href='base_url(profile/delete) . $pid'>Delete </a>");
但是我的URL就像http://localhost/profile/view_note/base_url(delete)
而不是http://localhost/profile/delete/$pid
任何帮助是极大的赞赏。 谢谢。
尝试这样使用:
$pid = $this->encrypt->encode($pid_info);
$data_user = array(
'first_name' => $first_name,
'delete' => '<a href="'.base_url().'/profile/delete/'. $pid'">Delete </a>"
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.