Jump to content

Recommended Posts

I wrote my website in PHP with Eclipse. My main page index.php uses the INCLUDE statement in order to display the sidebar and other part of the page, because these parts are also used by other pages.

 

My problem is that if I add the "<!DOCTYPE html PUBLIC..." to each include file, I receive error when validating my index.php because it finds several "<!DOCTYPE html PUBLIC..." inside the page.

 

But if I remove this "<!DOCTYPE html PUBLIC..." line from all include files, then Eclipse cannot validate my files as HTML.

 

Any idea how to solve this problem? You can check my website below.

 

GO CONDO TORONTO

 

 

Link to comment
https://forums.phpfreaks.com/topic/212205-php-include-statement/
Share on other sites

I wrote my website in PHP with Eclipse. My main page index.php uses the INCLUDE statement in order to display the sidebar and other part of the page, because these parts are also used by other pages.

 

My problem is that if I add the "<!DOCTYPE html PUBLIC..." to each include file, I receive error when validating my index.php because it finds several "<!DOCTYPE html PUBLIC..." inside the page.

 

But if I remove this "<!DOCTYPE html PUBLIC..." line from all include files, then Eclipse cannot validate my files as HTML.

 

Any idea how to solve this problem? You can check my website below.

 

GO CONDO TORONTO

 

They are not HTML files, they are portions of HTML or PHP that ouputs portions of HTML. Don't worry about those validating, only worry about the combined resultant page.

  • 2 months later...

I know. But the problem is that when you type your code in Eclipse you cannot turn the syntax check on. So you type code without knowing if you have problem or not. Only when you execute it, your browser will complain if there's an error in your PHP code.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.