Simon
Simon

Reputation: 1

codeigniter anchor set a ID

how can i put a ID on this

<?php echo anchor('profil', 'Profil'); ?>

i wanna echo a username ID to it like

<a href="profil.php?id=<?php echo $id; ?>">Profile</a>

Upvotes: 0

Views: 1567

Answers (1)

Alex Rashkov
Alex Rashkov

Reputation: 10015

echo anchor('profil.php?id='.$id, 'My News');

but you'd better use the CodeIgniter router and place the id as parameter, e.g:

echo anchor('profil/'.$id, 'My News');

this will output a link like:

http://www.site.com/profil/233

Upvotes: 2

Related Questions