在Codeigniter中我试图从form action
调用一个函数,我收到以下错误:
在此服务器上找不到请求的URL / chat // layercake / form_validation。
<form class="form-horizontal" id="contact" data-toggle="validator" enctype="multipart/form-data" role="form" method="post" action="<?php echo base_url().'/layercake/form_validation'; ?>">
<div class="form-group">
<label for="name" class="col-sm-2 control-label">Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="name" name="name" placeholder="First & Last Name" value="" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-2 control-label">Email</label>
<div class="col-sm-10">
<input type="email" class="form-control" id="email" name="email" placeholder="example@domain.com" value="" required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="message" class="col-sm-2 control-label">Message</label>
<div class="col-sm-10">
<textarea class="form-control" id="message" rows="4" name="message" required></textarea>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<div class="col-sm-10 col-sm-offset-2">
<input id="submit" name="submit" type="submit" value="Send" class="btn btn-primary">
</div>
</div>
<div class="form-group">
<div class="col-sm-10 col-sm-offset-2 alert">
</div>
</div>
</form>
请帮忙。
答案 0 :(得分:0)
您的行为URL
错了。将此action="<?php echo base_url().'/layercake/form_validation'; ?>"
更改为form
代码
action="<?php echo site_url('layercake/form_validation'); ?>"
答案 1 :(得分:0)
将您的操作网址base_url().'/layercake/form_validation';
更改为base_url().'layercake/form_validation';
请查看您的错误。 //
之后有两个chat
。