Reputation: 11
Hi iam new to php and html ,here i have one resolution,i just upload a picture in database as well as upload folder.and i put download button also.the download button is working to download as same window.but i have to show in new window.please see my code.
<input type="submit" onclick='this.form.action="download.php"'
name="agreement" id="butt_down"
value="<?php echo _l('Dowload'); ?>" class="submit_button">
foreach($_POST as $name=>$value)
{
echo karthik;
if($value=='Dowload')
{
if($name=='agreement'){
$filename=$_POST['filename1'];
}
if($name=='invoice'){
$filename=$_POST['filename2'];
}
}
}
$baseurl='uploads/'.$filename;
header("Location:$baseurl");
Upvotes: 1
Views: 897
Reputation: 42450
Wrap your input in a form. This way you can remove the javascript completely
<form action="download.php" method="post" target="_blank">
<input type="submit" name="agreement" id="butt_down" value="<?php echo _l('Dowload'); ?>" class="submit_button">
</form>
Upvotes: 1