简体   繁体   中英

Codeigniter - Base URL not working within the <a href=“”> tag

Sorry for this stupid question. I have searched for this question on stackoverflow but couldn't get an answer to my exact question.

Anyways.

This is my code:

$pid = $this->encrypt->encode($pid_info);
$data_user = array('first_name' => $first_name,
        'delete' => " <a href='base_url(profile/delete) . $pid'>Delete </a>");

But my URL is like http://localhost/profile/view_note/base_url(delete) instead of http://localhost/profile/delete/$pid

Any help is greatly appreciated. THanks.

try to use like this:

 $pid = $this->encrypt->encode($pid_info);
 $data_user = array(
   'first_name' => $first_name,
   'delete' => '<a href="'.base_url().'/profile/delete/'. $pid'">Delete </a>"
 );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM