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

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived