Welcome Guest, Not a member yet? Register   Sign In
Form is ignoring where I am trying to send it
#1

[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
#2

[eluser]mi6crazyheart[/eluser]
Can u post u'r code of "send" Controller function.
#3

[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());
}
}
}
#4

[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.
#5

[eluser]Bruno43[/eluser]
<div class="form_row">&lt;form action="http://www.siteurl.com/index.php/contact/send" method="post"&gt; <div class="label_float">
<label for="name">Name: </label>
</div>
<div class="input_float">

&lt;input type="text" name="name" id="name" value="" /&gt;
</div>
<br class="clear" />
</div>
<div class="form_row">
<div class="label_float">
<label for="email">Email Address: </label>
</div>

<div class="input_float">
&lt;input type="text" name="email" id="email" value="" /&gt;
</div>
<br class="clear" />
</div>
<div class="form_row">
<div class="label_float">
<label for="company">Company: </label>

</div>
<div class="input_float">
&lt;input name="company" id="company" value="" /&gt;
</div>
<br class="clear" />
</div>
<div class="form_row">
<div class="label_float">
<label for="comment">Comment: </label>

</div>
<div class="input_float2">
&lt;textarea name="comment" class="input_float2" id="comment" value="" /&gt;&lt;/textarea>
</div>
<br class="clear" />
</div>
<div class="form_row">&lt;input type="submit" name="submit" value="submit" /&gt; &lt;/form&gt;




Theme © iAndrew 2016 - Forum software by © MyBB