Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- class Captcha extends CI_Controller {
- function __construct() {
- parent::__construct();
- // load library dan helper
- $this->load->library('session');
- $this->load->helper(array('captcha','url','form'));
- }
- function cek() {
- $nama = $this->input->post('nama');
- $email = $this->input->post('email');
- if (empty($nama)) {
- $this->session->set_flashdata('notif','<p style="color:red;"><b>Mohon isi nama anda</b></p>');
- redirect('captcha');
- }
- if (empty($email)) {
- $this->session->set_flashdata('notif','<p style="color:red;"><b>Mohon isi email anda</b></p>');
- redirect('captcha');
- }
- echo "
- <script>
- alert('Terima kasih, data anda telah diterima.');
- window.location='".base_url()."';
- </script>
- ";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement