|
Posted by J.O. Aho on 06/20/07 04:40
Steven Borrelli wrote:
> Hello,
>
> I am using the <?php include() ?> statement on my website for
> organizational purposes. However, one of my includes contains some
> PHP code. Is there any way for the server to actually parse the
> include? I've tried this before, and it did not parse the include.
> Rather, it included the file as just plain ASCII.
If the main page is a php file, include will also make the included page to be
parsed by php.
I do suggest you use semicolon after each command, no matter if it's alone
between the php-tags or not.
It's always better to use .php as the file extension on the included files
too, this as .inc normally don't be set in the server to be parsed, which
leads to that if a person gives and url like
http://example.net/footer.inc
they will see the full source, and if you happen to have your database
login/password stored in the file, then they will know how to access it.
If you don't already, it's quite good to run apache web server and avoid iss.
--
//Aho
[Back to original message]
|