Welcome Guest, Not a member yet? Register   Sign In
Sending a Code to an Email Address in CodeIgniter
#13

(This post was last modified: 05-23-2017, 09:47 AM by christaliise.)

(05-23-2017, 08:18 AM)Wouter60 Wrote: You have this code in your controller:
PHP Code:
$code $this->input->post('code');
if (
$this->$code() === 'pass_word'

If you refer to $this-> .... it can either be a variable that has been declared for the class you're working in (the controller for instance), or a method ( = function) inside that class.
If it's a class level variable, it's $this->code. If it's a class level method, it's $this->code(). In both cases, $this->$code is wrong.

I think you simply want to check if the variable $code is equal to the literal string 'pass_word'.  So it should be:
PHP Code:
$code $this->input->post('code');
if (
$code === 'pass_word'

OK, thanks but it loads this;

PHP Code:
$this->load->view('codeincorrect'); 

I want it to load that only if the code is wrong.

If the code is correct I want it to load

PHP Code:
$this->load->view('username'); 

There maybe something wrong in the Model.
Reply


Messages In This Thread
RE: Sending a Code to an Email Address in CodeIgniter - by christaliise - 05-23-2017, 09:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB