php - incompatibility error - element is not allowed to be self closing in current schema

86

I had a html page that showed no incompatibility issues. I added some php code at the top for security purposes and now I get these following incompatibility issues due to the page now being a php page

This element is not allowed to be self-closing in the current schema. The schema is Internet Explorer 8.0. I tried removing the trailing "/" but it then said the empty element must have an end tag. I added and I get the error that it is an empty tag and cannot have a closing tag, it must have a closing slash. Looks like I came full circle.

This is just one example it occurs with all self closing elements. They are all fine when it is and html page. The pages still all function as designed and the php code I added is working perfectly. I am using MS Expression Web 3.0.

here is the php code,

<?php
    session_start();
    if(!session_is_registered('Admin')) :
    header('Location: admin_Login.php');
    endif;
    php?>

Thanks.

469

Answer

Solution:

You are using "php?>" as a closing PHP tag, which is wrong : it should be "?>"

i.e. you're PHP code should look like this :

<?php
// php code here
// more php code here
?>
466

Answer

Solution:

Second take:

Try removing all white space between after the closing?> and the start of your doctype and see whether that helps any.

698

Answer

Solution:

Guys, thanks for the effort. I just found the problem and it is a user error. I needed to select XHTML 1.0 transitional as the XHTML compatibility standard. Sorry about that, but I do appreciate your help.

People are also looking for solutions to the problem: php - Using HTML Entities in a Zend Form Select

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.