You can basically do it in two ways. First:
UPDATE:
The comment made by @Vickel is completely right! So I'm editing your html to what it should be.
Echoing a string:
<?php
if ( $_SESSION['user_id'] == $product["user_id"]){
// Wrong html
// echo '<a href="'. base_url() . '/KdGwController/details_bewerken/' . $product->product_id . '"><input type="button" class="btn btn-primary" value="Cadeau bewerken"></input> </a>';
// Right html
echo '<a class="btn btn-primary" href="'. base_url() . '/KdGwController/details_bewerken/' . $product->product_id . '"> Cadeau bewerken </a>';
}
?>
Second. Closing the PHP:
<?php
if ( $_SESSION['user_id'] == $product["user_id"]){
?>
<!-- Wrong html -->
<!-- <a href="<?php echo base_url() ?>/KdGwController/details_bewerken/<?php echo $product->product_id; ?>"><input type="button" class="btn btn-primary" value="Cadeau bewerken"></input> </a> -->
<!-- Right html -->
<a class="btn btn-primary" href="<?php echo base_url() ?>/KdGwController/details_bewerken/<?php echo $product->product_id; ?>"> Cadeau bewerken </a>
<?php
}
?>
I personally prefer the second because of the syntax highlight. An ever better way of doing this would be using the "syntax sugar if":
<?php if ( $_SESSION['user_id'] == $product["user_id"]): ?>
<!-- Wrong html -->
<!-- <a href="<?php echo base_url() ?>/KdGwController/details_bewerken/<?php echo $product->product_id; ?>"><input type="button" class="btn btn-primary" value="Cadeau bewerken"></input> </a> -->
<!-- Right html -->
<a class="btn btn-primary" href="<?php echo base_url() ?>/KdGwController/details_bewerken/<?php echo $product->product_id; ?>"> Cadeau bewerken </a>
<?php endif; ?>