Hi. I wish to redesign my site and wish to use php for some parts. I wish to use include function for this: <?php include("menu.php"); ?> Now i have the html template and when i add this function (the .html is renamed as .php to be parsed) i get a blank page. (menu.php exists and it is in the same directory as the template page page) What can be the problem ?
Yes, running www. mysite.com/menu.php show what should be included in the let's call it index.php page. But runing index.php it provides a blank page.
I've found one strange thing. The index.html works fine but if i rename it to index.php (to be parsed and to use include function) it didn't work. So the problem is more related to renaming index.html to index.php To see if this is a problem i've chunked the code to found the problem and i've discovered that the first line of the index.html was the problem. The first line said: <?xml version="1.0" encoding="iso-8859-1"?> After removing it, and renaming html => php, index.php works fine. And it works fine also with include function, so the problem is solved. Thanks for your reply, it helped me indirectly to solve the problem. Still one question. Is the line that I've removed important, or I can forget about it ?
It probably means that php short tags is enabled so it sees <?xml and starts parsing it as php but version= isn't correct php syntax so it fails. Without that line you might not validate W3-wise but your site should be fine in terms of functionality and spidering. You could solve it by echoing that line in PHP so it's not parsed.