• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
please help with active user select

#1
dear all,

please help me with this script

if ($this->form_validation->run() != FALSE){// echo 'valid';
$valid_user = $this->auth->trylogin($this->input->post("email"), $this->input->post("password"));


if(!$valid_user) {
$msg = '<div style="color: red;font-family:Letter Gothic Std;font-size: 12px;">' . lang('login_error') . '</div>';
}
if($active = 0)) {
$msg = 'your account is not active';
}


else {
redirect('product/catalogue');

}
}

i wanna make login check with active user alert.
please help me ....

thank you
udin_ordinary
Reply

#2
What will you do with the variable $msg? Print it out ( echo $msg; ) or put it into a view .. ? In your i second if-statement you have to check the value with ($active == 0) ...

But if your return value is "false" on your login check you have to test for the correct type otherwise (like your e.g.) !$valid_user is the same as $active == 0 so both statements get true. And if your login check gives you also an active status with 0 or 1 back you have to check something like that:

PHP Code:
if ($valid_user === false) { echo "wahhhh"; }
if (
$valid_user == 0) { echo "no active"; } 

So other question is, where comes your $active variable?

Reply

#3
Rufnex -> thank you rufnex.
udin_ordinary
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.