You are here: Re: HTML/PHP include files « HTML « IT news, forums, messages
Re: HTML/PHP include files

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация