Welcome Guest, Not a member yet? Register   Sign In
An Error Was Encountered Unable to load the requested file: home.php
#7

[eluser]theknight[/eluser]
[quote author="InsiteFX" date="1336685049"]See if this will work:
Code:
redirect(site_url(), 'refresh');

If it is crashing when the user trys to login twice, you should being
checking to see if user_id is already logged in.

Use CodeIgniters Form_validation class and set the rules on the user name to a callback
to see if the user name matches.

Check your session user_id and see if it matches your database record before trying to
log them in again.
[/quote]

Hi I am not storing session Ids within the database, rather I am creating them on the fly. As soon as the user logs in first time.

Code:
Here is where your problem is:
[code]
if(isset($_POST['username'])){ // logging in
// if they are already logged in you do not want to do this!
    $login_res=$this->members->login();
[/quote]

Is there anyway thru php I can check if the session has already been created, I uses $_SESSION variable to check but it was empty.

Doing this too:

echo $this->session->userdata('user');

Cheers.


Messages In This Thread
An Error Was Encountered Unable to load the requested file: home.php - by El Forum - 05-11-2012, 01:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB