[英]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.