Codeigniter not validation login formHow to submit a post-method form to same get-url in different function in CodeIgniter?PHP Codeigniter form submit using JQueryHow do you do jquery serialize with CodeIgniter?Not Showing Correct Form LabelCodeIgniter TankAuth ajax formsUsing AJAX request with CodeIgniter formsCodeigniter form validation is not showing errorsCodeigniter 4th level route not workinglogin form submit results in authentication failed in codeigniter 3.1.2Bootstrap 4 PHP Login won't hide the alert
Knowledge-based authentication using Domain-driven Design in C#
How do I exit BASH while loop using modulus operator?
Why is it a bad idea to hire a hitman to eliminate most corrupt politicians?
How to install cross-compiler on Ubuntu 18.04?
Forgetting the musical notes while performing in concert
What is an equivalently powerful replacement spell for the Yuan-Ti's Suggestion spell?
Where would I need my direct neural interface to be implanted?
How obscure is the use of 令 in 令和?
In the UK, is it possible to get a referendum by a court decision?
How to Prove P(a) → ∀x(P(x) ∨ ¬(x = a)) using Natural Deduction
Why do I get negative height?
Do Iron Man suits sport waste management systems?
What historical events would have to change in order to make 19th century "steampunk" technology possible?
Car headlights in a world without electricity
How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?
How can I prove that a state of equilibrium is unstable?
Why is the sentence "Das ist eine Nase" correct?
Why was Sir Cadogan fired?
How can a day be of 24 hours?
What does the same-ish mean?
Different meanings of こわい
Is it possible to create a QR code using text?
Mathematica command that allows it to read my intentions
Could the museum Saturn V's be refitted for one more flight?
Codeigniter not validation login form
How to submit a post-method form to same get-url in different function in CodeIgniter?PHP Codeigniter form submit using JQueryHow do you do jquery serialize with CodeIgniter?Not Showing Correct Form LabelCodeIgniter TankAuth ajax formsUsing AJAX request with CodeIgniter formsCodeigniter form validation is not showing errorsCodeigniter 4th level route not workinglogin form submit results in authentication failed in codeigniter 3.1.2Bootstrap 4 PHP Login won't hide the alert
I'm already pretty good with codeigniter so I feel pretty confident with my code. However, my form validation is not working. Its never passing validation, and never showing any errors. I've dumped out the CI
instance and can see my validations are set correctly, but no luck.
Here's the function in my controller
$this->load->helper(array('form', 'url', 'html'));
$this->load->library('form_validation');
$data = array();
$this->form_validation->set_rules('email', 'Email', 'trim|required');
$this->form_validation->set_rules('password', 'Password', 'trim|required');
$validation_errors = validation_errors();
if( $validation_errors !== FALSE ):
$data["validation_errors"] = $validation_errors;
endif;
if ($this->form_validation->run() == FALSE):
$this->load->view('common/head-auth', $data);
$this->load->view('pages/page-auth-login', $data);
$this->load->view('common/foot-auth');
else:
$this->load->model("site/users_model");
$this->users_model->login();
endif;
and here's the my view file
<main class="auth">
<header id="auth-header" class="auth-header"></header>
<?php
$atts = array("class" => 'auth-form');
echo form_open('auth/login', $atts);
?>
<div class="form-group">
<img src="<?php echo base_url( "assets/images/rplogo.png" ); ?>" alt="" width="100%">
</div>
<?php
if( isset( $validation_errors ) ):
$error_messages = "<div class="alert alert-danger alert-dismissible fade show">";
$error_messages .= "<button type="button" class="close" data-dismiss="alert">×</button>";
$error_messages .= $validation_errors;
$error_messages .= "</div>";
echo $error_messages;
endif;
?>
<div class="form-group">
<div class="form-label-group">
<input type="text" id="inputEmail" class="form-control" placeholder="Email Address" name="email" value="<?php echo set_value('email'); ?>">
<label for="inputUser">Email Address</label>
</div>
</div>
<div class="form-group">
<div class="form-label-group">
<input type="password" id="inputPassword" class="form-control" placeholder="Password" name="password">
<label for="inputPassword">Password</label>
</div>
</div>
<div class="form-group">
<button class="btn btn-lg btn-primary btn-block" type="submit">Log In</button>
</div>
<div class="text-center pt-3">
<a href="auth-recovery-password.html" class="link">Forgot Password?</a>
</div>
</form>
<footer class="auth-footer"> © 2019 All Rights Reserved. </footer>
and yes I have went through all other posts on this topic without a solution.
Thanks in advance
php codeigniter
add a comment |
I'm already pretty good with codeigniter so I feel pretty confident with my code. However, my form validation is not working. Its never passing validation, and never showing any errors. I've dumped out the CI
instance and can see my validations are set correctly, but no luck.
Here's the function in my controller
$this->load->helper(array('form', 'url', 'html'));
$this->load->library('form_validation');
$data = array();
$this->form_validation->set_rules('email', 'Email', 'trim|required');
$this->form_validation->set_rules('password', 'Password', 'trim|required');
$validation_errors = validation_errors();
if( $validation_errors !== FALSE ):
$data["validation_errors"] = $validation_errors;
endif;
if ($this->form_validation->run() == FALSE):
$this->load->view('common/head-auth', $data);
$this->load->view('pages/page-auth-login', $data);
$this->load->view('common/foot-auth');
else:
$this->load->model("site/users_model");
$this->users_model->login();
endif;
and here's the my view file
<main class="auth">
<header id="auth-header" class="auth-header"></header>
<?php
$atts = array("class" => 'auth-form');
echo form_open('auth/login', $atts);
?>
<div class="form-group">
<img src="<?php echo base_url( "assets/images/rplogo.png" ); ?>" alt="" width="100%">
</div>
<?php
if( isset( $validation_errors ) ):
$error_messages = "<div class="alert alert-danger alert-dismissible fade show">";
$error_messages .= "<button type="button" class="close" data-dismiss="alert">×</button>";
$error_messages .= $validation_errors;
$error_messages .= "</div>";
echo $error_messages;
endif;
?>
<div class="form-group">
<div class="form-label-group">
<input type="text" id="inputEmail" class="form-control" placeholder="Email Address" name="email" value="<?php echo set_value('email'); ?>">
<label for="inputUser">Email Address</label>
</div>
</div>
<div class="form-group">
<div class="form-label-group">
<input type="password" id="inputPassword" class="form-control" placeholder="Password" name="password">
<label for="inputPassword">Password</label>
</div>
</div>
<div class="form-group">
<button class="btn btn-lg btn-primary btn-block" type="submit">Log In</button>
</div>
<div class="text-center pt-3">
<a href="auth-recovery-password.html" class="link">Forgot Password?</a>
</div>
</form>
<footer class="auth-footer"> © 2019 All Rights Reserved. </footer>
and yes I have went through all other posts on this topic without a solution.
Thanks in advance
php codeigniter
What does this have to do with my issue?
– joeb
Mar 9 at 1:25
3
You are getting the validation errors before the form validation library actually runs the validation, therefore the validation errors are supposed to be empty. Form validation methodrun
validates the input values from users and fill the error array should there be any errors.
– Dominick Navarro
Mar 9 at 1:32
add a comment |
I'm already pretty good with codeigniter so I feel pretty confident with my code. However, my form validation is not working. Its never passing validation, and never showing any errors. I've dumped out the CI
instance and can see my validations are set correctly, but no luck.
Here's the function in my controller
$this->load->helper(array('form', 'url', 'html'));
$this->load->library('form_validation');
$data = array();
$this->form_validation->set_rules('email', 'Email', 'trim|required');
$this->form_validation->set_rules('password', 'Password', 'trim|required');
$validation_errors = validation_errors();
if( $validation_errors !== FALSE ):
$data["validation_errors"] = $validation_errors;
endif;
if ($this->form_validation->run() == FALSE):
$this->load->view('common/head-auth', $data);
$this->load->view('pages/page-auth-login', $data);
$this->load->view('common/foot-auth');
else:
$this->load->model("site/users_model");
$this->users_model->login();
endif;
and here's the my view file
<main class="auth">
<header id="auth-header" class="auth-header"></header>
<?php
$atts = array("class" => 'auth-form');
echo form_open('auth/login', $atts);
?>
<div class="form-group">
<img src="<?php echo base_url( "assets/images/rplogo.png" ); ?>" alt="" width="100%">
</div>
<?php
if( isset( $validation_errors ) ):
$error_messages = "<div class="alert alert-danger alert-dismissible fade show">";
$error_messages .= "<button type="button" class="close" data-dismiss="alert">×</button>";
$error_messages .= $validation_errors;
$error_messages .= "</div>";
echo $error_messages;
endif;
?>
<div class="form-group">
<div class="form-label-group">
<input type="text" id="inputEmail" class="form-control" placeholder="Email Address" name="email" value="<?php echo set_value('email'); ?>">
<label for="inputUser">Email Address</label>
</div>
</div>
<div class="form-group">
<div class="form-label-group">
<input type="password" id="inputPassword" class="form-control" placeholder="Password" name="password">
<label for="inputPassword">Password</label>
</div>
</div>
<div class="form-group">
<button class="btn btn-lg btn-primary btn-block" type="submit">Log In</button>
</div>
<div class="text-center pt-3">
<a href="auth-recovery-password.html" class="link">Forgot Password?</a>
</div>
</form>
<footer class="auth-footer"> © 2019 All Rights Reserved. </footer>
and yes I have went through all other posts on this topic without a solution.
Thanks in advance
php codeigniter
I'm already pretty good with codeigniter so I feel pretty confident with my code. However, my form validation is not working. Its never passing validation, and never showing any errors. I've dumped out the CI
instance and can see my validations are set correctly, but no luck.
Here's the function in my controller
$this->load->helper(array('form', 'url', 'html'));
$this->load->library('form_validation');
$data = array();
$this->form_validation->set_rules('email', 'Email', 'trim|required');
$this->form_validation->set_rules('password', 'Password', 'trim|required');
$validation_errors = validation_errors();
if( $validation_errors !== FALSE ):
$data["validation_errors"] = $validation_errors;
endif;
if ($this->form_validation->run() == FALSE):
$this->load->view('common/head-auth', $data);
$this->load->view('pages/page-auth-login', $data);
$this->load->view('common/foot-auth');
else:
$this->load->model("site/users_model");
$this->users_model->login();
endif;
and here's the my view file
<main class="auth">
<header id="auth-header" class="auth-header"></header>
<?php
$atts = array("class" => 'auth-form');
echo form_open('auth/login', $atts);
?>
<div class="form-group">
<img src="<?php echo base_url( "assets/images/rplogo.png" ); ?>" alt="" width="100%">
</div>
<?php
if( isset( $validation_errors ) ):
$error_messages = "<div class="alert alert-danger alert-dismissible fade show">";
$error_messages .= "<button type="button" class="close" data-dismiss="alert">×</button>";
$error_messages .= $validation_errors;
$error_messages .= "</div>";
echo $error_messages;
endif;
?>
<div class="form-group">
<div class="form-label-group">
<input type="text" id="inputEmail" class="form-control" placeholder="Email Address" name="email" value="<?php echo set_value('email'); ?>">
<label for="inputUser">Email Address</label>
</div>
</div>
<div class="form-group">
<div class="form-label-group">
<input type="password" id="inputPassword" class="form-control" placeholder="Password" name="password">
<label for="inputPassword">Password</label>
</div>
</div>
<div class="form-group">
<button class="btn btn-lg btn-primary btn-block" type="submit">Log In</button>
</div>
<div class="text-center pt-3">
<a href="auth-recovery-password.html" class="link">Forgot Password?</a>
</div>
</form>
<footer class="auth-footer"> © 2019 All Rights Reserved. </footer>
and yes I have went through all other posts on this topic without a solution.
Thanks in advance
php codeigniter
php codeigniter
edited Mar 9 at 20:38
joeb
asked Mar 8 at 20:45
joebjoeb
353219
353219
What does this have to do with my issue?
– joeb
Mar 9 at 1:25
3
You are getting the validation errors before the form validation library actually runs the validation, therefore the validation errors are supposed to be empty. Form validation methodrun
validates the input values from users and fill the error array should there be any errors.
– Dominick Navarro
Mar 9 at 1:32
add a comment |
What does this have to do with my issue?
– joeb
Mar 9 at 1:25
3
You are getting the validation errors before the form validation library actually runs the validation, therefore the validation errors are supposed to be empty. Form validation methodrun
validates the input values from users and fill the error array should there be any errors.
– Dominick Navarro
Mar 9 at 1:32
What does this have to do with my issue?
– joeb
Mar 9 at 1:25
What does this have to do with my issue?
– joeb
Mar 9 at 1:25
3
3
You are getting the validation errors before the form validation library actually runs the validation, therefore the validation errors are supposed to be empty. Form validation method
run
validates the input values from users and fill the error array should there be any errors.– Dominick Navarro
Mar 9 at 1:32
You are getting the validation errors before the form validation library actually runs the validation, therefore the validation errors are supposed to be empty. Form validation method
run
validates the input values from users and fill the error array should there be any errors.– Dominick Navarro
Mar 9 at 1:32
add a comment |
1 Answer
1
active
oldest
votes
if ($this->form_validation->run() == FALSE):
$validation_errors = validation_errors();
if( $validation_errors !== FALSE ):
$data["validation_errors"] = $validation_errors;
endif;
$this->load->view('common/head-auth', $data);
$this->load->view('pages/page-auth-login', $data);
$this->load->view('common/foot-auth');
else:
$this->load->model("site/users_model");
$this->users_model->login();
endif;
You are correct. There was also an issue in my view where I wasn't echoing out the error messages that were coming through. Double negatives. Thanks for the help
– joeb
Mar 9 at 20:37
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55070748%2fcodeigniter-not-validation-login-form%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
if ($this->form_validation->run() == FALSE):
$validation_errors = validation_errors();
if( $validation_errors !== FALSE ):
$data["validation_errors"] = $validation_errors;
endif;
$this->load->view('common/head-auth', $data);
$this->load->view('pages/page-auth-login', $data);
$this->load->view('common/foot-auth');
else:
$this->load->model("site/users_model");
$this->users_model->login();
endif;
You are correct. There was also an issue in my view where I wasn't echoing out the error messages that were coming through. Double negatives. Thanks for the help
– joeb
Mar 9 at 20:37
add a comment |
if ($this->form_validation->run() == FALSE):
$validation_errors = validation_errors();
if( $validation_errors !== FALSE ):
$data["validation_errors"] = $validation_errors;
endif;
$this->load->view('common/head-auth', $data);
$this->load->view('pages/page-auth-login', $data);
$this->load->view('common/foot-auth');
else:
$this->load->model("site/users_model");
$this->users_model->login();
endif;
You are correct. There was also an issue in my view where I wasn't echoing out the error messages that were coming through. Double negatives. Thanks for the help
– joeb
Mar 9 at 20:37
add a comment |
if ($this->form_validation->run() == FALSE):
$validation_errors = validation_errors();
if( $validation_errors !== FALSE ):
$data["validation_errors"] = $validation_errors;
endif;
$this->load->view('common/head-auth', $data);
$this->load->view('pages/page-auth-login', $data);
$this->load->view('common/foot-auth');
else:
$this->load->model("site/users_model");
$this->users_model->login();
endif;
if ($this->form_validation->run() == FALSE):
$validation_errors = validation_errors();
if( $validation_errors !== FALSE ):
$data["validation_errors"] = $validation_errors;
endif;
$this->load->view('common/head-auth', $data);
$this->load->view('pages/page-auth-login', $data);
$this->load->view('common/foot-auth');
else:
$this->load->model("site/users_model");
$this->users_model->login();
endif;
answered Mar 9 at 1:35
Dominick NavarroDominick Navarro
717516
717516
You are correct. There was also an issue in my view where I wasn't echoing out the error messages that were coming through. Double negatives. Thanks for the help
– joeb
Mar 9 at 20:37
add a comment |
You are correct. There was also an issue in my view where I wasn't echoing out the error messages that were coming through. Double negatives. Thanks for the help
– joeb
Mar 9 at 20:37
You are correct. There was also an issue in my view where I wasn't echoing out the error messages that were coming through. Double negatives. Thanks for the help
– joeb
Mar 9 at 20:37
You are correct. There was also an issue in my view where I wasn't echoing out the error messages that were coming through. Double negatives. Thanks for the help
– joeb
Mar 9 at 20:37
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55070748%2fcodeigniter-not-validation-login-form%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What does this have to do with my issue?
– joeb
Mar 9 at 1:25
3
You are getting the validation errors before the form validation library actually runs the validation, therefore the validation errors are supposed to be empty. Form validation method
run
validates the input values from users and fill the error array should there be any errors.– Dominick Navarro
Mar 9 at 1:32