Hi, all
I use following code on a web page to activate a php program, comServer.php,
on the server site to create a PDF file and show it when it's returned.
Quote:
|
my=document.createElement('form');
|
my.action='../../comServer.php';
my.target='_blank';
my.method='post';
document.body.appendChild(my);
xsValue="field1=1&field2=2&field3=3";
ar=xsValue.split("&");
for(i1 in ar){
my1=document.createElement('input');
my1.type='hidden';
j1=ar[i1].indexOf("=");
my1.name=ar[i1].substr(0,j1);
my1.value=ar[i1].substr(j1+1);
my.appendChild(my1);
}
my.submit();
my.removeNode(true);
Quote:
|
On server site, after the pdf is created, the following code will send it
|
out.
Quote:
|
header("Content-Type: application/pdf");
|
header("Content-Disposition: inline");
return file_get_contents(zTEMP_FOLDER . $sPdfFileName);
On the client site the IE 6 browser most time shows the pdf content. But
sometimes it doesn't show anything. I check the PDF file was created without
problem. Thank you in advance!
Jack