CodeIgniter Forums

Full Version: load->view() problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I have everything working so far except I seem to have a problem with one method where $this->load->view() does not work.

It's a simple function to check if the user has submitted a username and password and then set session variables to be used later on.

Here is the part that does not seem to want to work:
$username = $this->input->post('username');
$password = $this->input->post('password');
    if (!$username) {
(note that I have tried !$username, $username == false and $username === false)

edit: I have also checked to see if the if statement is working by putting exit('asdf') in

the code for error.php is just a generic error page
<p>Sorry, there was an error with your request. Please try again later.</p>

Am I doing something wrong?

Any help would be appreciated,

El Forum


You can try this & it will work
if (!isset($username))

Also, you can skip .php extensions when calling views

Happy Coding,

El Forum

I tried that, and unfortunately it's still not working.

The problem isn't that the if statement isn't working ("I have also checked to see if the if statement is working"), the problem is that load->view() doesn't work

edit: that cheat sheet in your signature is going to be very helpful.. Glad I decided to take a look at it

El Forum

I fixed it.. somewhat..
I still couldn't get load->view() to work for the life of me so I just did it manually
$message = 'You can not access the login page directly';
(there is a variable for message in flash.php)