getting php to validate xHTML strict

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • praclarush
    New Member
    • Oct 2007
    • 27

    getting php to validate xHTML strict

    php version 5.2.5

    well here’s the problem, I have this home work for a class, in it we just had to copy things out of the book as they have it and follow along basically. Then the teacher add extra things onto it, one of them is to make sure everything validates xHTML strict. That’s fine except I can't get this small piece of code to validate, can anyone offer a little help. I’m new to the whole php thing.

    [PHP]<p><input type="text" name="number" size="20" value="<?php if (!empty($_GET['number'])) echo $_GET['number'] ?>" /></p>[/PHP]

    the validation page works if you get rid of the ">" but then the whole script stops working
    Last edited by praclarush; Feb 20 '08, 01:06 AM. Reason: Removed extra spaces
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Originally posted by praclarush
    php version 5.2.5

    well here’s the problem, I have this home work for a class, in it we just had to copy things out of the book as they have it and follow along basically. Then the teacher add extra things onto it, one of them is to make sure everything validates xHTML strict. That’s fine except I can't get this small piece of code to validate, can anyone offer a little help. I’m new to the whole php thing.

    [PHP]<p><input type="text" name="number" size="20" value="<?php if (!empty($_GET['number'])) echo $_GET['number'] ?>" /></p>[/PHP]

    the validation page works if you get rid of the ">" but then the whole script stops working
    you dont' validate the code from the server (with php code in it) you validate the RESULT of the page.

    i.e. do a view source, copy and paste that into your XHTML validator.

    XHTML means everything has to be in valid XML style.

    XML style is

    <tagname attributename=" value">content aslkdfalskd</tagnam>

    or

    <tagname />

    Comment

    • praclarush
      New Member
      • Oct 2007
      • 27

      #3
      Originally posted by dlite922
      you dont' validate the code from the server (with php code in it) you validate the RESULT of the page.

      i.e. do a view source, copy and paste that into your XHTML validator.

      XHTML means everything has to be in valid XML style.

      XML style is

      <tagname attributename=" value">content aslkdfalskd</tagnam>

      or

      <tagname />
      Thanks for the help, sorry I didn't post earler,
      praclarush
      Last edited by praclarush; Feb 21 '08, 04:39 PM. Reason: Spelling

      Comment

      Working...