logo
down
shadow

code igniter form_validation not work


code igniter form_validation not work

By : user2951256
Date : November 18 2020, 01:01 AM
wish of those help i have a problem with form validation, this is just standart form validation. , this is so dumb, i forgot to add
code :
<?php echo validation_errors(); ?>


Share : facebook icon twitter icon
How do get form_validation to work properly in Code Igniter

How do get form_validation to work properly in Code Igniter


By : Wael Ghonim
Date : March 29 2020, 07:55 AM
With these it helps
When I enter the correct email and an incorrect password = the page loads white
code :
if($user->password == $this->encrypt->sha1($user->salt.$this->encrypt->sha1($this->input->post('password_login')))) {
        $this->session->set_userdata(array(
            'email' => $this->input->post('email_login')
        ));
        redirect('account/edit');
        exit;
    }
}
// do nothing?
$this->form_validation->set_rules(
    'email_login',
    'Email',
    'required|is_unique[your_table.your_email_field]'
);
$_POST super globals don't load when using form_validation library in code igniter 3

$_POST super globals don't load when using form_validation library in code igniter 3


By : ozan çivlik
Date : March 29 2020, 07:55 AM
Hope this helps The problem is the redirect. The $_POST is only available after the post. After redirect the var is deleted.
To access the username and password you should save those values in a session var. But it's not recommended to save passwords anywhere => insecure!!
code :
<?php 
    class Admin extends CI_Controller{
        public function __construct(){
            parent::__construct();
            $this->load->model('admin_model');
            $this->load->helper(array('form','url'));
            $this->load->library('session');
        }
        public function login(){
            $this->load->library('form_validation');
            $this->form_validation->set_rules('adminuser','Username','required');
            $this->form_validation->set_rules('password','Password','required');

            if($this->form_validation->run()==FALSE){           
                $this->load->view('admin/login');
            }
            else{
                $this->session->set_userdata('adminuser', $this->input->post('adminuser'));
                $this->session->set_userdata('password', $this->input->post('password'));  // not recommended! => insecure
                redirect('admin/success');
            }

        }
        public function success(){
             echo $this->session->userdata('adminuser');
             echo $this->session->userdata('password');
        }
        public function home(){
            if(isset($_SESSION['adminuser'])){
                redirect('admin/login');
            }
            else{
                echo "set";
            }
        }
    }
?>
Validating multidimensional arrays in Code Igniter with form_validation library

Validating multidimensional arrays in Code Igniter with form_validation library


By : user3806133
Date : March 29 2020, 07:55 AM
it fixes the issue It looks like you're using the wrong library. The Validation library is deprecated. Try using Form_validation (libraries/form_validation.php) instead.
Code Igniter form_validation load fatal error

Code Igniter form_validation load fatal error


By : Abinet Solomon
Date : March 29 2020, 07:55 AM
will help you The only way I could reproduce that error was to flip-flop the position of library and the validation:
code igniter $this->form_validation->run() always returns false

code igniter $this->form_validation->run() always returns false


By : Larry K
Date : March 29 2020, 07:55 AM
help you fix your problem , You missed the method attribute in form tag. It should be
Related Posts Related Posts :
  • How to add Smarty templating engine to CodeIgniters 3 framework?
  • Am I maxing out possible data insert
  • Redirect to homepage without changing address bar URL
  • What is the best user-Id Value for a MySql "users" table
  • PHP $_COOKIE is only available in one directory
  • php regular expressions documantation
  • cannot import too large sql file to mysql
  • not getting appilcation/json in content-type in header
  • Only the first data display from my database but other shows but not on a table
  • Is it possible to have a print button link as the content of the mail
  • how to extract full mail address in imap php
  • Alternative to output buffering to put eval'd code into a variable
  • how to run wordpress php snippet mysql update command from ssh and/ultimately cron
  • how to get xml tag by name
  • ModSecurity maximum post limits (PCRE limit errors)
  • Call controller/action in event listener
  • How to improve performance of contacting WebService?
  • PHP nest variable in echoed string that contains a HTML tag in the end
  • Multiple Ajax request for PHP framework
  • Debug Info from Moodle Plugin
  • passing variables through page
  • Passing PHP $result data to Javascript
  • cakePHP File Download was not found or not readable
  • batch waiting until script finishes
  • PHP variables and anchors in URL
  • php eTag generation using php
  • How to check whether the array is an Integer or Not?
  • Is it possible to install Doctrine without PEAR or Composer? If so, how?
  • Call view script of (parent) Abstract controller Zend
  • Curl PHP cannot display amazon
  • Symfony, getters and setters vs magic methods
  • Using 'continue' PHP instruction outside the loop
  • AJAX POST return data not appearing
  • Can I query relations using an INNER JOIN instead of two queries in Eloquent?
  • Looping through dynamic form fields and inserting into database
  • My php code can't select mysql auto_increment value
  • Store Angularjs form data in database using php
  • I want to run my sh file continuously even if I close my Putty connection
  • file_get_contents equivalent for gzipped files
  • Include PHP file with jQuery
  • php curl headers do not return from website?
  • How to find out, if facebook ID is a user, group or page
  • Connect webhost database to android database
  • preg_match get div content with class
  • Upload multiple files in Laravel 4
  • Count array numbers in multidimensional array
  • PHP Date diff with a difference
  • Search Customer by custom field in Netsuite
  • Is it possible to hide/encode/encrypt php source code and let others have the system?
  • list items to be displayed using php code and array
  • check if row exists mysqli
  • PHP errors loading MySQL
  • setup PostgreSQL with Laravel in MAMP
  • PHP - CodeIgniter Notifications
  • Encrypting a password column in a SQL database
  • New to PHP, trying to extract information from another website
  • JavaScript AmChart to Image for Email
  • Is javascript validation enough to keep my forms secure?
  • Regex extract variables from [shortcode]
  • Download a .mp3 link and save it to computer with PHP
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org