-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
93 additions
and
55 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
class Login extends CI_Controller { | ||
public function index(){ | ||
$this->load->helper(array('form', 'url')); | ||
|
||
$this->load->library('form_validation'); | ||
|
||
$this->form_validation->set_rules('username', 'Username', 'required'); | ||
$this->form_validation->set_rules('password', 'Password', 'required'); | ||
|
||
if ($this->form_validation->run() == FALSE) | ||
$this->load->view('login'); | ||
|
||
// load the homepage if login successful | ||
// https://www.codeigniter.com/user_guide/libraries/form_validation.html#callbacks-your-own-validation-methods | ||
else { | ||
$this->load->view('formsuccess'); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
class Register extends CI_Controller { | ||
public function index(){ | ||
$this->load->helper(array('form', 'url')); | ||
|
||
$this->load->library('form_validation'); | ||
|
||
$this->form_validation->set_rules('name', 'Name', 'required'); | ||
$this->form_validation->set_rules('email', 'Email', 'required'); | ||
$this->form_validation->set_rules('username', 'Username', 'required'); | ||
$this->form_validation->set_rules('password', 'Password', 'required', | ||
array('required' => 'You must provide a %s.')); | ||
$this->form_validation->set_rules('email', 'Email', 'required'); | ||
|
||
$this->form_validation->set_rules('email', 'Email', 'required|valid_email'); | ||
|
||
if ($this->form_validation->run() == FALSE) | ||
$this->load->view('register'); | ||
|
||
// load the homepage once properly submitted | ||
// https://www.codeigniter.com/user_guide/libraries/form_validation.html#callbacks-your-own-validation-methods | ||
else { | ||
$this->load->view('formsuccess'); | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
$this->load->library('form_validation'); | ||
echo validation_errors(); | ||
echo form_open('login'); ?> | ||
|
||
<h5>Username</h5> | ||
<input type="text" name="username" value="<?php echo set_value('username'); ?>" size="50" /> | ||
<?php echo form_error('username'); ?> | ||
|
||
<h5>Password</h5> | ||
<input type="password" name="password" value="<?php echo set_value('password'); ?>" size="50" /> | ||
<?php echo form_error('password'); ?> | ||
|
||
<br><br> | ||
<div><input type="submit" value="Submit"/></div> | ||
|
||
</form> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
$this->load->library('form_validation'); | ||
echo validation_errors(); | ||
echo form_open('register'); ?> | ||
|
||
<h5>Name</h5> | ||
<input type="text" name="name" value="<?php echo set_value('name'); ?>" size="50" /> | ||
<?php echo form_error('name'); ?> | ||
|
||
<h5>Email Address</h5> | ||
<input type="text" name="email" value="<?php echo set_value('email'); ?>" size="50" /> | ||
<?php echo form_error('email'); ?> | ||
|
||
<h5>Username</h5> | ||
<input type="text" name="username" value="<?php echo set_value('username'); ?>" size="50" /> | ||
<?php echo form_error('username'); ?> | ||
|
||
<h5>Password</h5> | ||
<input type="password" name="password" value="<?php echo set_value('password'); ?>" size="50" /> | ||
<?php echo form_error('password'); ?> | ||
|
||
<br><br> | ||
<div><input type="submit" value="Submit"/></div> | ||
|
||
</form> |