![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: php |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |||
| [SOLVED] PHP syntax question Hello, PHP newbie here, and have a question about syntax variations I've noticed. If anybody could explain, and/or point me to a tutorial that explains proper syntax "do's and dont's" I would appreciate it. On the page at Making a CAPTCHA I see this code... <form method="POST"> <img src="captcha.php" /> <br /> Enter the above text EXACTALY as it appears. Note: It is case sensitive<br /> <input type="text" name="captcha_code" /> <br /> <input type="submit" name="submit" value="Submit" /> </form> I am confused as to why some of the '>' characters are preceeded with a '/' character, but others are not. In this case, it looks like everything within the FORM tags are "with", but the FORM tags don't have the '/' character. Thanks in advance. Melissa |
| |
| ||||
| oh, I probably can answer your question to that. There are various HTML document out there, which can be identified by looking at the very beginning of the code. www.programmerstalk.net for example, when you do view source on the home page. You will see something like this in the beginning of the document: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> hopefully that helps..!btw.. those are not PHP, those are HTML ![]() Last edited by HelloWorld : 06-20-2007 at 07:39 AM. |
| |||
| Hello nailed it. If you see <br /> it's XHTML and <br> is HTML. The reason for the difference is that XHTML requires all tags to be closed. If you look at the <form> and </form> tags in the example you posted the </form> closes the <form> tag. But <br> and <input> don't have closing versions - there isn't a </br> or </input>, they just wouldn't make sense. So they have to close themselves by becoming <br /> and <input />. Personally, I use HTML for a majority of my sites and only use XHTML when the CMS requires it. |
![]() |
| Thread Tools | |
| Display Modes | |
| |