<?php $link = $_GET['link']; ?> <script> if(confirm( "You will be redirected to <?php echo 'http://' . $link; ?>.")) { location = "http://<?php echo $link; ?>"; } else { history.back(); } </script>