You can store the users id in the session then assign it to the view data.
PHP Code:
$data['userID'] = $userID;
Then in your view you can create the link like so or use CodeIgniters anchor helper.
PHP Code:
<a href="<?= base_url('adverts/createadvert/'.$userID);?>">Create Advert</a>
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )