www.webdeveloper.com
Results 1 to 5 of 5

Thread: W3C Validator & PHP code

  1. #1
    Join Date
    May 2010
    Posts
    35

    W3C Validator & PHP code

    I'm having an issue with the following code running through the validator.

    PHP Code:
    <input type="text" id="uname" name="uname" value="<?php print "$uname"?>" size="30" />
    It gives an error about the PHP code in the value section. Can someone help me get past this?

    Thanks

  2. #2
    Join Date
    Nov 2008
    Posts
    2,477
    The PHP code itself is irrelevant as the validator only ever sees the output from the processed code. What is contained in the $uname variable?

    PHP Code:
    var_dump($uname
    The first rule of Tautology Club is the first rule of Tautology Club.

  3. #3
    Join Date
    Nov 2008
    Posts
    2,477
    double post.
    The first rule of Tautology Club is the first rule of Tautology Club.

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,359
    Note that you should not be submitting your PHP source code directly to the validator: you want to submit the [X]HTML that it outputs when the PHP script is executed. If it's on a web site, you can just submit the URL to the validator. Otherwise if testing locally, run the script in your browser, then do a "View Source" in the resulting browser page, and copy-and-paste that to the browser. Even easier is to use the "Web Developer" extension in Firefox, and after the page is displayed, do a Tools -> Web Developer -> Tools -> Validate Local HTML.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    May 2010
    Posts
    35
    Quote Originally Posted by NogDog View Post
    Note that you should not be submitting your PHP source code directly to the validator: you want to submit the [X]HTML that it outputs when the PHP script is executed. If it's on a web site, you can just submit the URL to the validator. Otherwise if testing locally, run the script in your browser, then do a "View Source" in the resulting browser page, and copy-and-paste that to the browser. Even easier is to use the "Web Developer" extension in Firefox, and after the page is displayed, do a Tools -> Web Developer -> Tools -> Validate Local HTML.
    WOW! That is why I love this site! I am developing it locally & this is exactly what I needed!

    Thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles