Looking for some help

To all,
I have a program that creates a html file and then turns that html file into a PDF.
Then the PDF gets emaiedl. When I get the email it is a attachment. The information is correct.
When viewing the file, I see what looks like javascript in the file. The php script does use javascript at the very end of the program. I have included the php script as a txt. It is called show_invoice and the PDF output. I don’t no what is causing this

Thank You

Adobe Acrobat does use Javascript to control behaviour. I had a quick look and I am not sure that I see anything wrong. Yet, I would suggest that you be consistant with your qouting.

If you use single quotes, then always use single quotes, or double qoutes, and if you mixed them, please do it right because I suspect that’s where your error is.

As an example, you line

var script2 = "<script language=\\"javascript\\">" + script;

I think that is supposed to be

var script2 = '<script language="javascript">' + script;

In this way, you avoid to have to escape the double quotes and it is easier to read.

If that doesn’t work, then you will have to look into the code of the page pdf.php and see how the variables are received and added as xml nodes to the pdf document.

When I change the " quotes to ’ single and take out the escape characters the program stops working at that point.

Here is what the code looks like now:

[COLOR=“Navy”]<script language=“javascript”>
var html2 = document.getElementsByTagName(‘html’)[0].innerHTML;
var html = ‘<html>’+html2+‘</html>’;
var form = document.getElementsByTagName(‘form’)[0].innerHTML;
var form2 = ‘<form id=“foo” name=“foo” method=“post” action=“pdf.php” target=’_blank’>‘+form+’</form>';
var html3 = html.replace(form2,“”);
var script = document.getElementsByTagName(‘script’)[0].innerHTML;
var script2 = ‘<script language=“javascript”>’ + script;
var html4 = html3.replace(script2,“”);
document.getElementsByTagName(‘textarea’)[0].value = html4;
document.getElementById(‘invoice’).value = document.location.href;
function submitForm(){