Hi, Can someone tell me how to fix a problem I am having (I am a newbie to PHP): I am working on http://journalaccess.com and I am coming accross an issue where: I use <?php require(); ?> to include my header however when I do this the index.php page shows the info from the header (<div class="h2"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:/) in the body of the index page, which shows as errors in strict 1.0 whenever I try to validate it. Should I even be using <?php require(); ?>, or should I use something else? Help is appreciated. And if you would like to throw in some tips that would be great too, thanks!
There's nothing wrong with using require(), you just have to restructure your site so that it appears as it should. We can't help you with that, with the bit of code you gave us. Perhaps it's easier for you if you use more separate files. You can use as many require()s as you want.
Why do you have <div class="h2"> in your header? Or maybe it's in the index.php, before the code that calls require(), if so then remove it, the header is the full header. Or change it in such way that the DOCTYPE is stored in index.php and then require() a header file which contains only the rest (head, html, body).
its very hard to validate a page or make a page without having errors if you are using php as the code is broken in many files.There are many rules ,tags, and attributes which fails validation.To me best posible thing before you know php you should know html and css first because without that you will allways have problems Regards Alex