<form id="contact-form" action="<?=site_url()?>/main/add_contact" onsubmit="return Validate()" method="POST">
<div class="inline-inputs">
<div class="col-lg-6 col-md-6 col-sm-12">
<label>Name*</label>
<input type="text" name="username" id="username">
<?php if ($this->session->flashdata('username')) {?><b style="color: red"><?=$this->session->flashdata('username')?></b><?php }?>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<label>Phone*</label>
<input type="text" name="phone" id="phone">
<?php if ($this->session->flashdata('phone')) {?><b style="color: red"><?=$this->session->flashdata('phone')?></b><?php }?>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<label>Email Address*</label>
<input type="email" name="email" id="email">
<?php if ($this->session->flashdata('email')) {?><b style="color: red"><?=$this->session->flashdata('email')?></b><?php }?>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<label>Subject*</label>
<input type="text" name="subject" id="subject">
<?php if ($this->session->flashdata('subject')) {?><b style="color: red"><?=$this->session->flashdata('subject')?></b><?php }?>
</div>
<div class="col-lg-12 col-md-12 col-sm-12">
<label>Message*</label>
<textarea rows="10" cols="10" name="query" id="query"style = 'resize:none;'></textarea>
<?php if ($this->session->flashdata('query')) {?><b style="color: red"><?=$this->session->flashdata('query')?></b><?php }?>
</div>
</div>
<input type="submit" value="submit"/>
</form>
在此表单提交后,操作将转到控制器中的方法,我已设置验证并保留
重定向(SITE_URL() '/主/接触', '刷新'。);
即使控制器中存在该方法,为什么我也不会在表单提交后没有刷新页面。
表单提交后页面应该显示flash数据,它没有刷新,当我在提交后手动刷新页面然后我可以看到flashdata ..