Welcome Guest, Not a member yet? Register   Sign In
Captcha Not working With Database
#1

[eluser]razerone[/eluser]
Hi. I have been reading understanding the captcha. I have set up my tables in my database but for some reason I have trouble setting it up on my contact controller and view. I tried to place correct parts in controller but no luck

All way come up with error. I don't understand the codeigniter way. Here is way my contact controller is not sure where best to place controller side of things

Code:
class Contact extends MX_Controller {
function __construct() {
parent::__construct();
$this->lang->load('information/contact', 'english');
$this->lang->load('common/header', 'english');
$this->lang->load('common/footer', 'english');
$this->lang->load('english', 'english');
$this->load->library('email');
$this->load->library('form_validation');
}
function index() {
$this->load->view('common/header_views');
$this->load->view('contact_views');
$this->load->view('common/footer_views');
}
function confirmation() {
$this->form_validation->set_rules('name', 'Name', 'required|min_length[3]|max_length[30]');
$this->form_validation->set_rules('email', 'Email', 'required|valid_email');
$this->form_validation->set_rules('subject', 'Subject', 'required');
$this->form_validation->set_rules('message', 'Enquiry', 'required|min_length[15]|max_length[3000]');
$name = $this->input->post('name');
$email = $this->input->post('email');
$subject = $this->input->post('subject');
$message = $this->input->post('message');
$this->email->from($email, $name);
$this->email->to('[email protected]');
$this->email->subject($subject);
$messagebody = "Senders Name:" . " \n\n" . $name . " \n\n" .
"Senders Subject:" . " \n\n" . $subject . " \n\n" .  
"Senders Email:" . " \n\n" . $email . " \n\n" .
"Senders Message:" . " \t\n\n" . $message;
$this->email->message($messagebody);
if ($this->form_validation->run() == FALSE) {
// Message Error Area
$this->load->view('common/header_views');
$this->load->view('contact_views');
$this->load->view('common/footer_views');
} else {
// Message Sent Area
$this->email->send();
$this->load->view('common/header_views');
$data['message_success'] = '<div class="alert alert-success">Your Message has Been Sent <strong>Thank You!</strong></div>';
$this->load->view('contact_views', $data);
$this->load->view('common/footer_views');
}
}
}
#2

[eluser]Tpojka[/eluser]
I can't see you even tried using captcha in code you've provided.
Have you check CI captcha helper?
Or maybe some of custom made libraries?




Theme © iAndrew 2016 - Forum software by © MyBB