Hi everyone,i have a problem when i use advanced custom field,i use custom field to embed iframe to my video site,with 2 server

And here my code in theme
<button class="button" type="button" onClick="document.getElementById('frame').src='<?php the_field('server_1'); ?>'">Openload</button>
<button class="button" type="button" onClick="document.getElementById('frame').src='<?php the_field('server_2'); ?>'">Openload 2</button>
<center><iframe name="frame" id="frame" src="<?php the_field('server_1'); ?>" width="640" height="360" scrolling="no" frameborder="0"></iframe></center>
But problem is,i just use these code for few new posts,and old posts not,so any chance to hide these content if custom field is empty (server 1 and server 2) ? Thank you.
if (get_field('server_1')) {
?>
<button class="button" type="button" onClick="document.getElementById('frame').src='<?php the_field('server_1'); ?>'">Openload</button>
<center><iframe name="frame" id="frame" src="<?php the_field('server_1'); ?>" width="640" height="360" scrolling="no" frameborder="0"></iframe></center>
<?php
}
Thank you..at first it didnt work,after i googled,i found i missing <php code
here
<?php if( get_field('server_1') ): ?>
<button class="button" type="button" onClick="document.getElementById('frame').src='<?php the_field('server_1'); ?>'">Openload</button>
<center><iframe name="frame" id="frame" src="<?php the_field('server_1'); ?>" width="640" height="360" scrolling="no" frameborder="0"></iframe></center>
<?php endif; ?>