Can't get user id from session |
Hello, so i'm trying to insert the user id to a table named "services", but it seems that session('id') isn't working, but when i'm tring to insert it in "images" table, it's working fine, can any one help me with that ?
Link to my controller : https://pastebin.com/5dLDUQMc
When I gave a look at your codes I could'nt see that you started a session first.
When the user log in, a session should start first. Then you can call any information related to it. or, if your url contains an id, you can get it via : PHP Code: $id = $this->request->uri->getSegment(2); *2 can be 1 or 3. Depends on your url (05-13-2021, 09:29 AM)demyr Wrote: When I gave a look at your codes I could'nt see that you started a session first.Hello, thank you for your reply, si i started a session when the user logs in, in the "login" controller here the link to that : https://pastebin.com/1SXynPBF
Hi again,
Your codes don't look healthy. For example, you are trying to start your session with an email, not with a password match. And your password area doesn't have any encryption. I am leaving my codes below: PHP Code: public function login_process (){ Within your other methods in controller, just follow this : PHP Code: public function another_method(){ |
Welcome Guest, Not a member yet? Register Sign In |