当我点击它发布的链接时,它像: http://localhost/belajarci/index.php/calculator/localhost/belajarci/ind-6ren">
gpt4 book ai didi

php - 单击 href 时,Codeigniter 在地址栏中发布双链接

转载 作者:搜寻专家 更新时间:2023-10-31 21:02:04 26 4
gpt4 key购买 nike

帮我写这段代码。

 <a href="<?php echo site_url('calculator/');?>"><< Kembali menghitung</a>

当我点击它发布的链接时,它像: http://localhost/belajarci/index.php/calculator/localhost/belajarci/index.php/calculator

我尝试删除 href 值,但该页面未引用主页,它只是更改了我代码中的另一个值。

最佳答案

它在双 url 上重定向是正确的,因为您需要在文件/ Controller 构造函数中包含 $this->load->helper('url') 或使用 url helperautoload.php

还要在你的配置中做两件事:

  1. 检查项目中的 .htaccess 文件,因为您可能在那里设置了任何 url 重定向。
  2. 在配置文件中检查您在那里设置的基本 url。

关于php - 单击 href 时,Codeigniter 在地址栏中发布双链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40042196/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com