i'm PHP Programmer and i'm Here to Help PHP developers with php coding




The following XHTML rules differentiate it from HTML:

i found this in part of the book of php mysql & javascript
The following XHTML rules differentiate it from HTML:
• All tags must be closed by another tag. In cases in which there is no matching
closing tag, the tag must close itself using a space followed by the symbols / and
>. So, for example, a tag such as <input type='submit'> needs to be changed into
<input type='submit' />. In addition, all opening <p> tags now require a closing
</p> tag, too. And no, you can’t replace them with <p />.
• All tags must be correctly nested. Therefore the string <b>My first name is
<i>Robin</b></i> is not allowed, because the opening <b> has been closed before
the <i>. The corrected version is <b>My first name is <i>Robin</i></b>.



• All tag attributes must be enclosed in quotation marks. Instead of using tags
such as <form method=post action=post.php> you should instead use
<form method='post' action='post.php'>. You can also use double quotes:
<form method="post" action="post.php">.
• The ampersand (&) character cannot be used on its own. For example, the string
“Batman & Robin” must be replaced with “Batman &amp; Robin”. This means
that URLs require modification, too. So the HTML syntax <a href="index.php?
page=12&item=15"> should be replaced with <a href="index.php?
page=12&amp;item=15">.
• XHTML tags are case-sensitive and must be all in lowercase. Therefore HTML
such as <BODY><DIV ID="heading"> must be changed to the following syntax:
<body><div id="heading">.
• Attributes cannot be minimized any more, so tags such as <option name="bill"
selected> now must be replaced with an assigned value: <option name="bill"
selected="selected">. All other attributes such as checked and disabled also need
to be changed to checked="checked", disabled="disabled", and so on.
• XHTML documents must start with a new XML declaration on the very first line,
like this: <?xml version="1.0" encoding="UTF-8"?>.
• The DOCTYPE declaration has been changed.
• The <html> tag now requires an xmlns attribute.


Read more...