Codeigniter 表单提交添加操作 url 和网站 url

Codeigniter form submission adds action url with website url

我正在尝试在 Codeigniter 中提交表单操作我的 url 是 "Registration/register" 当我提交它时,它正在添加现有 url 的操作。我的英语太差了,详情请看附件图片。

示例:我的网站 Url 是示例。com/d2t/index。php/Registration 我正在添加像 action = "Registration/register".

这样的表单动作

然后它将我的表单 url 添加到我的网站 url:示例。com/d2t/index.php/Registration/Registration/register

使用site_url()方法

action="<?php echo site_url("Registration/register") ?>"

或者您可以使用表单助手:

echo form_open('Registration/register');

http://www.codeigniter.com/userguide3/helpers/form_helper.html?highlight=form%20helper