Results 1 to 3 of 3

Thread: Inline PHP not validating.

  1. #1
    Join Date
    Sep 2008
    Posts
    14
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Inline PHP not validating.

    Hello all, I have some php which is not validating at W3C.

    For example one of the messages points me to this line.
    Warning Line 60, Column 83: character "<" is the first character of a delimiter but occurred as data.

    …>User Name <input type="text" value="<?php echo $_SESSION['username']; ?>" id
    It seems like it is failing where the inline php starts i.e "<" .

    Does anyone know how to solve this.

    Dallr

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Try this:
    Code:
    <input type="text" value="<?=$_SESSION['username'];?>"...
    That should work, if it doesn't then ignore it it's just a bug in they're validation. If you were to post this online[http://example.com] and validated that it wouldn't see it. So you can just replace the value with the real value just to get the badge, then change it back and when people click on your badge it will show up as valid because the validation can't see PHP (because it's not open source).
    Jeremy | jfein.net

  3. #3
    Join Date
    Apr 2008
    Location
    Limoges, France
    Posts
    395
    Thanks
    13
    Thanked 61 Times in 61 Posts

    Default

    Hi,

    I think there must be something else wrong with your code somewhere.

    I do the same thing you are doing all the time and have never had a problem with W3C validation.

    Post all of the compiled code (the code you get when you "view source" in your browser). Or tell me the url of this page.

    J

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •