表单动作重定向到http//localhost/xampp,而不是指定的位置


Form action redirect to http//localhost/xampp not to the specified location

我是CodeIgniter的新手。我有一个主页的形式控制器形式。我想当点击提交在主页重定向到注册功能在控制器的形式但是它重定向到http//localhost//xampp

这是Home_view视图

<?php $id = 1; ?>
<form action="<?php echo base_url('login_c/signup/' . $id); ?>" method="post" >
  <input type="submit" value="Sign up" />
</form>

这是表单控制器

public function index()
    {
        $this->load->helper('url');
         $this->load->view('Home_view');
    }

     public function signup($id)
    {
        echo$id;
         $this->load->view('myproject/Signup_v');
    }

是的,问题可能与您的.htaccess有关。试一次,

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]