Ok, so I've a script that outputs HTML.  If a particular
argument is passed to that script, it sends the following
header commands before it echoes out any HTML:

header( "Content-Disposition: inline; filename=policy.doc" );
header( "Content-type: application/msword" ); 

so that it opens up and displays the HTML in ms-word.
That should be all I need to make it open up properly in
Word.  However, it's not working.

One of the very first things that the script does is some
validation and if it fails, echoes out some javascript to
force the user back to the previous page - history.back().
The relevant code is:

if( myValidationFunctionsFakeName()) {
    echo "<script language=\"javascript\">history.back();</script>\n";

So unless that check fails, the javascript *never* gets 
echoed out.

What's happening is that when I try to output the HTML
to Word (by using the header() functions), the only thing
in the document (after it opens up) is the javascript.  I
can remove the header calls and the HTML displays just
fine in the browser.  Add them back in, the javascript is 
the only thing that shows up in Word.

But why?  Why is PHP echoing out something it should
not be echoing?  The validation doesn't fail so as such,
the text should never be sent to stdout (the browser).
Or am I misunderstanding something?


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to