Jump to content

PHP "include"tags possible?


goldenrose

Recommended Posts

Hi there!I confess I am very new to XHTML... Up until now I was fine with HTML and that little PHP mixed up into it, but yeah, we all learn at all times, right?So now I am currently using the include-tags on my homepage, because they are really cool and I don't like inline frames anymore. So I wanted to know if there is a way to still use this function when I want to convert my page into XHTML or XML to validate my coding?Thanks in advance...Lynn

Link to comment
Share on other sites

php doesnt have anything to do with xhtml or html. It just displays information so you can make pages dynamic. So it wont affect anything about your html, just the html will :). There is also a secure html include. but you need to save pages as .shtml.

Link to comment
Share on other sites

There is also a secure html include. but you need to save pages as .shtml.
Um... that's actually "server parsed HTML". It's ordinary HTML with some commands (much like PHP) that most often are actually Apache's SSIs.As said, what the cliend (and the validator) see is the output of the PHP, not the PHP itself. The output of a PHP can be HTML, XHTML, XML or anything else you like. It doesn't matter.
Link to comment
Share on other sites

Can I then validate the the source with the validator? Because then, of course, the data is spread over three files, does the validator recognize the including of the other files? Or do I have to include the other stuff manually first, then validate it and then spread it out again?

Link to comment
Share on other sites

Can I then validate the the source with the validator? Because then, of course, the data is spread over three files, does the validator recognize the including of the other files? Or do I have to include the other stuff manually first, then validate it and then spread it out again?
No. There isn't a "php validation service", but if you submit a php file to the w3c validator, it validates the (x)html that is produced by the page as if it were simply an (x)html page without any php or includes. All the include function, and php in general, does is allow you to do things 'dynamically'. Meaning search databases and have conditional branching logic and stuff which (x)html does not allow. Essentially, you are using php to write the (x)html code to the client's browser and then using CSS to 'style' the presented material.Gets confusing sometimes trying to place the blame for errors.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...