Created
June 6, 2012 00:30
-
-
Save ckdarby/2879121 to your computer and use it in GitHub Desktop.
Issue #1328
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* application/controllers/welcome.php | |
* | |
*/ | |
class Welcome extends CI_Controller { | |
public function index() | |
{ | |
$this->load->helper('form'); | |
$this->load->library('form_validation'); | |
$this->form_validation->set_rules('title', 'Title', 'required|min_length[2]|trim|xss_clean|alpha_dash'); | |
$test_input = $this->input->post(); | |
if(!empty($test_input)) { | |
$this->load->library('form_validation'); | |
if ($this->form_validation->run() == FALSE) | |
{ | |
} | |
} | |
$this->load->view('welcome_message'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- application/views/welcome_message.php --> | |
<div id="container"> | |
<?php | |
echo validation_errors(); | |
echo form_open('/'); | |
?> | |
<h5>Title</h5> | |
<input type="text" name="title" value="" size="50" /> | |
<div><input type="submit" value="Submit" /></div> | |
</form> | |
<? | |
echo form_close(); | |
?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment