开发者

why target="blank" doesn't open a new window

开发者 https://www.devze.com 2023-04-12 09:05 出处:网络
I am going to show $Content in a new window. after some searches I found the following code. but it doesn\'t open a new window and echoes $content in the same page.

I am going to show $Content in a new window. after some searches I found the following code. but it doesn't open a new window and echoes $content in the same page.

 <form method="POST" action=" <?php echo $Content; ?> " target="blank"></form>

update: THIS IS THE CODE:

    <?php

if(isset($_POST['submit'])) 
{

include 'library/config.php';
include 'library/opendb.php'; 
$Unit_Code    = $_POST['Unit_Code'];
$File_Name    = $_POST['File_Name'];
$_SESSION['Unit'] =$Unit_Code;
$_SESSION['file'] =$File_Name;
$query = "SELECT Unit_Code,File_Name, type,size, Content FROM Units WHERE ((Unit_Code = '$Unit_Code')&&(File_Name='$File_Name'))";
$result = mysql_query($query) or die(mysql_error());
list($Unit_Code, $File_Name, $type, $size,  $Content) = mysql_fetch_array($result);
header("Content-length: $size");
header("Content-type: $type");
header("Content-Disposition: attachment; filename=$File_Name");
?>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="dblclick.js"></script>
</head>

<body>
<form method="POST" action=" <?php echo $Content; ?> " target="_bla开发者_StackOverflow社区nk"></form>

</body>
</html>

<?php 
include 'library/closedb.php'; 
exit;
}

?>


It's target="_blank". The underscore is important.


You missed the _

<form action="URL TO POST THE FORM" method="POST" target="_blank">
  <?php echo $Content; ?>
</form>


Missing: _ before targetin your HTML attribute: < .. target="_blank">

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号