|
Posted by Jon Slaughter on 04/19/07 22:16
<snip>
>
> Jon,
> ARGH (this is why I don't program for a living). I kept thinking
> about the fact that no php commands were working and eventually
> stumbled across my dilemna. My nav.php file was called
> "jennifer.html," rather than "jennifer.php."
>
> I thought that I could include an html file from a php statement
> (above, my syntax was wrong...the jennifer.php was actually
> jennifer.html) and that php would just embed the html, but the only
> change I made from it "not working" to "working" is renaming the
> *.html file to *.php. Ironically, a colleague also looked at the code
> visually and through Dreamweaver and said that everything looked all
> right. I seem to recall from some of the tutorials that including an
> html file was acceptable, but maybe not...or I have a directive that
> is interfering. Anyway, this is a big thorn out of my side.
>
lol. Yeah, I think everyone makes that mistake at first. I know I did. When
you include html it is processed as html.
There is something about that on the help
http://us2.php.net/include/
"When a file is included, parsing drops out of PHP mode and into HTML mode
at the beginning of the target file, and resumes again at the end. For this
reason, any code inside the target file which should be executed as PHP code
must be enclosed within valid PHP start and end tags."
Jon
Navigation:
[Reply to this message]
|