i have a link that is stored in videoembed custom field in my posts
i want registered only users to see this link
this is what i have right now
$download =<a href="<?php $key="videoembed"; echo get_post_meta($post->ID, $key, true);?>">Download</a>;
<?php
if (is_user_logged_in()){
echo $download;
}
else {
echo '<a href="http://www.vitamovie.com/site/wp-register.php">Download - Please Register and Log In</a>';
};
?>
but this displays in the page source
$download =<a href="http://site.com/blah/blah.mp4">Download</a>;
and you see
$download =Download;
the "Download" being the correct link, how do i get rid of the $download or what is the correct way of writing this
tx in advance