Form is ignoring where I am trying to send it |
[eluser]Bruno43[/eluser]
Probably a simple question and sorry a head of time but I have <?php echo form_open('contact/send'); ?> But its ignoring wherever I am trying to send it to and just self submitting as a get. No errors are being thrown up, its not even trying to hit the /send event. Any help would be much appreciated. Thanks
[eluser]mi6crazyheart[/eluser]
Can u post u'r code of "send" Controller function.
[eluser]Bruno43[/eluser]
function send(){ $this->load->library('form_validation'); $this->form_validation->set_rules('name', 'Name', 'trim|required'); $this->form_validation->set_rules('email', 'Email Address', 'trim|required|valid_email'); $this->form_validation->set_rules('company', 'Company', 'trim'); $this->form_validation->set_rules('comment', 'Comment', 'trim|required'); if($this->form_validation->run() == FALSE){ $this->index(); }else{ $name = $this->input->post('name'); $email = $this->input->post('email'); $comment = $this->input->post('comment'); $this->load->library('email'); $this->email->set_newline("\r\n"); $this->email->from($email, $name); $this->email->to('[email protected]'); $this->email->cc('[email protected]'); $this->email->subject('Contact Form from Site'); $this->email->message($comment); if($this->email->send()){ $data['main_content'] = 'confirmation_view'; $this->load->view('includes/template', $data); }else{ show_error($this->email->print_debugger()); } } }
[eluser]mi6crazyheart[/eluser]
It seems u'r "send" controller function part is ok. Have u seen u'r form's html codes ? if not have a look on that too.
[eluser]Bruno43[/eluser]
<div class="form_row"><form action="http://www.siteurl.com/index.php/contact/send" method="post"> <div class="label_float"> <label for="name">Name: </label> </div> <div class="input_float"> <input type="text" name="name" id="name" value="" /> </div> <br class="clear" /> </div> <div class="form_row"> <div class="label_float"> <label for="email">Email Address: </label> </div> <div class="input_float"> <input type="text" name="email" id="email" value="" /> </div> <br class="clear" /> </div> <div class="form_row"> <div class="label_float"> <label for="company">Company: </label> </div> <div class="input_float"> <input name="company" id="company" value="" /> </div> <br class="clear" /> </div> <div class="form_row"> <div class="label_float"> <label for="comment">Comment: </label> </div> <div class="input_float2"> <textarea name="comment" class="input_float2" id="comment" value="" /></textarea> </div> <br class="clear" /> </div> <div class="form_row"><input type="submit" name="submit" value="submit" /> </form> |
Welcome Guest, Not a member yet? Register Sign In |