I'm trying to call jsfunction() from php. This jsfunction() will redirect me to code.php. But, it's not working and not showing any error.
<?php
    $sid=$_GET['link'];
    echo '<script type="text/javascript">';
    echo  'jsfunction();';
    echo   '</script>';
?>
<script type="text/javascript"></script>
<script>
    function jsfunction()
    {
        var site_id="<?php echo $sid; ?>";
        window.location.href = "code.php?site_id=" + site_id; 
    }
</script>
 
     
     
     
     
    