Re: Syntax Error -> This is WEIRD!
| From: | Nick Wilson | Date: | Tue, 20 Jan 2004 09:41:52 +0000 |
| Subject: | Re: Syntax Error -> This is WEIRD! | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175113@lists.php.net to get a copy of this message | ||
* and then Dagfinn Reiersøl declared....
> >Yes your right, that?s exactly the problem. I didn?t even realize he was
> >doing that.
> >
> >By including the PHP file via HTTP, you are including the OUTPUT of the PHP
> >file, not the actual PHP file itself.
> >
> >e.g.
> >
> >by including a file with the following code:
> >
> ><?PHP
> >
> > print 'Hello';
> >
> >?>
> >
> >you would be including the word "Hello" as PHP code, which is obviously
> >going to cause a syntax error.
> >
> >
> Yes. I read the manual which provides no clear explanation (I suspect
> that whoever wrote it didn't actually know how it works). So I decided
> to test it. It does exactly what you say it does. I made an include file
> like this:
>
> <?php
> echo '<?php echo "Hello World!"; ?>';
> ?>
>
> If you inlude that using HTTP, it outputs "Hello world!"
>
> Seems like a strange thing to do, outputting PHP code on a Web page, but
> it's not without conceivable usefulness.
That does appear to be the trouble doesnt it? - thanks guys, i'm now
talking to the support people for this CMS and trying to work out how to
do it differently/correctly!
Thanks for all the help!
--
Nick W