-
Notifications
You must be signed in to change notification settings - Fork 6
/
Website.php
41 lines (32 loc) · 1017 Bytes
/
Website.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
defined('BASEPATH') OR exit('u no here');
class Website extends CI_Controller {
public function __construct ()
{
parent::__construct();
}
public function index()
{
$this->load->view('form');
}
public function submission()
{
if (!$this->input->is_ajax_request()) { exit('no valid req.'); }
$FormRules = array(
array(
'field' => 'website',
'label' => 'Website Address',
'rules' => 'required|min_length[5]|max_length[30]'
)
);
$this->form_validation->set_rules($FormRules);
if ($this->form_validation->run() == TRUE)
{
echo '<div class="success">Your website is submitted</div>';
}
else
{
echo '<div class="errors">'.validation_errors().'</div>';
}
}
}