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













1















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










share|improve this question
























  • 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















1















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










share|improve this question
























  • 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













1












1








1








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










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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

















  • 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
















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












1 Answer
1






active

oldest

votes


















3














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;





share|improve this answer























  • 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











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
);



);













draft saved

draft discarded


















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









3














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;





share|improve this answer























  • 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















3














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;





share|improve this answer























  • 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













3












3








3







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;





share|improve this answer













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;






share|improve this answer












share|improve this answer



share|improve this answer










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

















  • 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



















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page