我有这个代码: -
<form action="<?php echo base_url();?>login/process" method="post" name="process">
<h2>User Login</h2>
<br />
<?php if(! is_null($msg)) echo $msg;?>
<label for="username">Username</label>
<input type="text" name='username' id='username' size="25" /><br />
<label for="password">Password</label>
<input type="password" name="password" id='password' size="25" /><br />
<input type="Submit" value="Login" />
</form>
但它不起作用。
当我删除此链接
<form action="<?php echo base_url();?>login/process" method="post" name="process">
之后就可以了。
现在我的问题是如何在CodeIgniter中使用表单URL。
我知道我们也可以这样做:
<?=form_open('main/index/')?>
但我现在不想改变我的代码。
答案 0 :(得分:0)
你不能在codeigniter中使用。而不是使用它:
<?php echo form_open('admin/login/chk_admin');?>
<h2>User Login</h2>
<br />
<?php if(! is_null($msg)) echo $msg;?>
<label for="username">Username</label>
<input type="text" name='username' id='username' size="25" /><br />
<label for="password">Password</label>
<input type="password" name="password" id='password' size="25" /><br />
<input type="Submit" value="Login" />
</form>