08-08-2010, 09:47 PM
[eluser]Unknown[/eluser]
Hi guys,
I'm having trouble getting an email to send because I keep getting a 404 error when I press the submit button. I'm not sure if it isn't the second function in my main controller.
Here is my code so far home.php
Here is the part of the html that I think is of note, if you need any more info please let me know.
Hi guys,
I'm having trouble getting an email to send because I keep getting a 404 error when I press the submit button. I'm not sure if it isn't the second function in my main controller.
Here is my code so far home.php
Code:
<!--
Name: INSERT
Date: INSERT
File: INSERT
Desc: INSERT
-->
<?php
class Home extends Controller{
function index(){
$this->load->view('home_view');
return true;
}
function sendemail(){
$to = $this->input->post('you');
$subject = $this->input->post('subject');
$message = $this->input->post('contactbody');
mail($to, $subject, $message);
$this->load->view('home_view');
}
}
Here is the part of the html that I think is of note, if you need any more info please let me know.
Code:
<div class="divider" id="contact">
<p class = "header"><a name="gocontact">Contact</a></p>
<form method = "post" id="contactform" action="<?php base_url()?>/sendemail">
<div id ="formtitles">
<p class = "info">You:</p>
<p class = "info">Me:</p>
<p class = "info">Subject:</p>
<p class = "info">Body:</p>
<input type="submit" value="Send" />
</div>
<div id ="formfields">
<form>
<input id="you" type="text" name="you" /><br/>
<p class = "info">Here is some info</p>
<input id ="subject" type="text" name="subject" /><br/>
<textarea id = "contactbody"></textarea>
</div>
</form>
</div>