Afficher un message
Vieux 20/06/2007, 05h40   #2
J.O. Aho
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Parsing a php include (which also contains php code) - or "Reparsing"the php file

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
  Réponse avec citation
 
Page generated in 0,04600 seconds with 9 queries