first.php
<?php
$file_name='1.pdf';
?>
<script type='text/javascript'>
window.open('pdf/<?php echo $file_name;?>','_blank')
<script>
<?php
header('location:second.php');
?>
second.php
<?php
echo 'Welcome..!';
?>
In this above coding i have to run first.php it can't open pdf file new tab directly goto this second.php.
anyone have a solution for my problem.i have to view pdf file in new tab on this time first.php redirect to second.php.
location.href = '/your/url/here';