Welcome Guest, Not a member yet? Register   Sign In
How to redirect using $this-session-userdata(country_territory)
#16

(09-28-2019, 10:16 AM)Wouter60 Wrote: Move this line from controller to view:
PHP Code:
$user_id $this->session->userdata('user_id'); 

Or put the $user_id in an array which is passed to the view.
Controller:
PHP Code:
$data['user_id'] =  $this->session->userdata('user_id'); 
$this->load->view('createadvert'$data); 

In both cases, the $user_id variable will be available in the view.

Thanks Wouter60, I did try your first option but it didn't work, or at least open the page. I do need to put more coding into the Controller to try your 2nd option.

Can you answer my previous query about before a User creates an advert I want to give them an option of the advert layout, for example the "Description - Images - Ingredients - Details" to be in different places on the page?

Similar to what Yahoo do in the layout of email pages. Do you know of any site where I can learn that?
Reply


Messages In This Thread
RE: How to redirect using $this-session-userdata(country_territory) - by christaliise - 09-28-2019, 04:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB