简体   繁体   English

代码点火器网址加倍

[英]code igniter url doubling

I'm having an issue where when I submit a form where the submit URL the just appends to the existing URL instead of replacing it. 我遇到一个问题,当我提交表单时,提交URL只是追加到现有URL而不是替换现有URL。

It is supposed to be: 应该是:

localhost/DataConnect/index.php/sites/MakeEdit/1

But instead I get: 但是我得到了:

localhost/DataConnect/index.php/sites/EditSite/localhost/DataConnect/index.php/sites/MakeEdit/1

I open the form with: 我打开表单:

echo form_open('sites/MakeEdit/'.$site['ID'],$attributes,$hidden);

So Im not real sure where I am going wrong. 因此,我不确定自己要去哪里。 If there is any more information I can provide please let me know. 如果我能提供更多信息,请告诉我。 Thanks in advance. 提前致谢。

try: 尝试:

echo form_open(base_url().'sites/MakeEdit/'.$site['ID'],$attributes,$hidden);

and don't forget to call the url helper on your controller: 并且不要忘记在您的控制器上调用url帮助器:

$this->load->helper('url');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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