如何将php echo放在html url中?

So i'd like to have the following:

example/sharer/sharer.php?u=http://example.com/blahblah

It is to change URL based on the page that its on so I used the below

example/sharer/sharer.php?u=<?php echo $share['reference_url'];?>">

When i do this i only see the following as the url

example/sharer/sharer.php?u=

So Question is how do i get both together? What is wrong with the below that is making the variable URL not show up. If i put it into a alone by itself the reference_url shows up just fine

example/sharer.php?u=<?php echo $share['reference_url'];?>">