基于知识树的PHP流式pdf安全

基于知识树的PHP流式pdf安全,php,html,pdf,Php,Html,Pdf,任何人都曾体验过从知识树中安全地输出php蒸汽pdf 我正试图写一个PHP脚本,但问题在于上面的知识树。我测试了knowlege tree没有安全性,但它正在工作。因为我们不想让公众看到。这是给员工的 PHP代码:- Security :- <form class="login-form" action="https://<kt server name>.knowledgetree.com/plugins/passwordResetPlugin/loginResetEmail

任何人都曾体验过从知识树中安全地输出php蒸汽pdf

我正试图写一个PHP脚本,但问题在于上面的知识树。我测试了knowlege tree没有安全性,但它正在工作。因为我们不想让公众看到。这是给员工的

PHP代码:-

Security :-

<form class="login-form" action="https://<kt server name>.knowledgetree.com/plugins/passwordResetPlugin/loginResetEmailDispatcher.php" method="POST" name="login">
<input type="hidden" name="action" value="login" />
<input type="hidden" name="cookieverify" value="" />
<input type="hidden" name="redirect" value="https://<kt server name>.knowledgetree.com/action.php?kt_path_info=ktcore.actions.document.view&fDocumentId=<doc ID>" />
<input name="username" type="hidden" value="example@mail.co.uk" />
<input name="password" type="hidden" value="password"  />
<input id="downloadButton" type="submit" value="Login" style="display:none" />
</form>


No security:-

<form method="post" action="test.php">
<input type="hidden" name="url" value="https://<kt server name>.knowledgetree.com/action.php?kt_path_info=ktcore.actions.document.view&fDocumentId=<doc ID>" /> 
<input id="downloadButton" name="submit"  type="submit" style='display:none' />
</form>

<script language="javascript"> 
document.getElementById("downloadButton").click();
</script>


<?php $destination_folder = 'downloads/';

$url = $_POST['url']; (no security)

$url = $_POST['redirect']; (security)

$newfname = $destination_folder . basename($url);

$newname = $destination_folder . basename($url, "").".pdf";

$file = fopen ($url, "rb");

if ($file) {
  $newf = fopen ($newname, "wb");

  if ($newf)
  while(!feof($file)) {
    fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 );
  }
}

if ($file) {
  fclose($file);
}

if ($newf) {
  fclose($newf);
  sleep(1);    
rename ($newname, "downloads/example.pdf"); 
} ?>


<iframe src="/downloads/example.pdf" style="border: 0; position:absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%"></iframe>
安全性:-
无担保:-
document.getElementById(“下载按钮”)。单击();
请告诉我怎么做

我认为需要使用php curl