Validation PHP files containing HTML

Discussion in 'PHP' started by gazza52_2000, Aug 18, 2007.

  1. #1
    HI,

    I've just finished my first PHP/HTML page wohoo!!.

    As a requirement i need to have all my HTML validated which i have done before using W3C.

    Only problem is my files are .php and when i upload them to be validated they will not as it requires a .html extention. My php wont work if i change the extention.

    How do i get round this?

    Thanks
     
    gazza52_2000, Aug 18, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Don't upload the PHP files. Upload the files to your server, and browse to them using your web browser. Once there, save the parsed file with a .html extension. Then upload THIS file. Or just enter the URL to the uploaded file...
     
    nico_swd, Aug 18, 2007 IP
  3. gazza52_2000

    gazza52_2000 Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    My files are already on the server, do i need to use a copy of my php file as a html?

    Do i need to remove php from my file as it will pull the php up with an error?
     
    gazza52_2000, Aug 18, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    The PHP code will be parsed on the server, and only HTML will remain. So you don't have to remove any PHP code. The easiest way would be inserting the URL of your uploaded file in the validator. If you still want to upload them, browse to the file, and on your web browser, click on "File" -> "Save page as". Then upload this file.
     
    nico_swd, Aug 18, 2007 IP
    srobona likes this.
  5. gazza52_2000

    gazza52_2000 Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Ok, so all i need to do is validate using the url or upload and copy my php files to a .html extention so they can be recognised.

    Thanks
     
    gazza52_2000, Aug 18, 2007 IP