[eluser]smick[/eluser]
Greetings,
I'm experiencing a PHP error when using CI's validation class. Unable to track the error down, I did a fresh install of CI (version: 1.6.3) and used minimal code to test validation yet still I receive error. The error is question is:
Quote:Severity: Notice
Message: Undefined property: CI_Validation::$username
My test code was swiped from the documentation and is as follows:
Controller:
Code:
<?php
class Test_validation extends Controller {
function index()
{
$this->load->helper(array('form', 'url'));
$this->load->library('validation');
$rules['username'] = "required";
$rules['password'] = "required";
$rules['passconf'] = "required";
$rules['email'] = "required";
$this->validation->set_rules($rules);
if ($this->validation->run() == FALSE)
{
$this->load->view('test_validation');
}
else
{
$this->load->view('test_validation');
}
}
}
?>
View:
Code:
<html>
<head>
<title>My Form</title>
</head>
<body>
<?php echo $this->validation->error_string; ?>
<?php echo form_open('test_validation'); ?>
<h5>Username</h5>
<input type="text" name="username" value="<?php echo $this->validation->username;?>" size="50" />
<h5>Password</h5>
<input type="text" name="password" value="<?php echo $this->validation->password;?>" size="50" />
<h5>Password Confirm</h5>
<input type="text" name="passconf" value="<?php echo $this->validation->passconf;?>" size="50" />
<h5>Email Address</h5>
<input type="text" name="email" value="<?php echo $this->validation->email;?>" size="50" />
<div><input type="submit" value="Submit" /></div>
</form>
</body>
</html>
I have successfully used CI's validation class in the past. Might my host have changed something on me?
Also, I'm working on a super clean and super easy to implement user auth model which I hope to share with the community when complete. What would be the proper channel through which to submit this?
Thanks for the help,
Nathan