how to redirect in new tab using php?
<p>I am trying to rediect in new page if file is not present but is not redirecting,but if i only write alert then it is working. Please help me.</p>

<pre><code>//php code

&lt;?PHP 
if(isset($_POST["bills"]))
{
if($_POST[month]=='Select Month' || $_POST[year]=='Select Year'){$msg="Please select valid month or year";}
else if(file_exists($path.$_POST["month"].$_POST["year"].'.pdf')){header('location:'.$path.$_POST[month].$_POST[year].'.pdf');}
else{?&gt;
&lt;script type='text/javascript' language="javascript"&gt;document.getElementById('downloadlink').click();&lt;/script&gt;
&lt;?PHP }
}
?&gt;

//html code

&lt;form action="electricitybills.php" method="post" &gt;
&lt;select name="year"&gt;
&lt;?PHP include('include/billsyear.php'); ?&gt;
&lt;/select&gt;
&lt;select name="month"&gt;
&lt;?PHP include('include/billsmonth.php'); ?&gt;
&lt;/select&gt;
&lt;div class="gobutton"&gt;&lt;input type="submit" name="bills" value="GO"&gt;&lt;/div&gt;
&lt;/form&gt;

    &lt;/div&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a id="downloadlink" href="http://www.google.com" target="_blank" style="display:none;"&gt;link text&lt;/a&gt;&lt;/form&gt;
</code></pre>
