[thelist] Use JavaScript includes to insert PHP into a site?

Andrew Clover and at doxdesk.com
Thu Jan 10 15:44:37 CST 2002


Bill Haenel <bill at webmarketingworx.com> wrote:

> document.write("<? PHPSTUFF ?>");

> There's probably a better or more conventional method

<iframe> springs to mind, as it'll work without JavaScript and you won't
need all those document.write()s.

> I'd love to know why it's no good, though, if it is, indeed, no good.

I would guess because PHP documents are served by default as text/html.
You might want to add something like -

  <?php header ("Content-Type: text/javascript"); ?>

can't be sure that's it though, as I'm not much of a PHP guru, having never
actually used it. ;-)

-- 
Andrew Clover
mailto:and at doxdesk.com
http://and.doxdesk.com/




More information about the thelist mailing list