Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Page 1 of 2 12 LastLast
Results 1 to 15 of 22

This is a discussion on XHTML errors on server in the Shared & Semi-Dedicated forum
Alright. I have moved back into web development, after quiet some time off. I have been learning CSS properly as well as XHTML strict. Well ...

  1. #1
    Histerical, absolute
    Join Date
    Aug 2002
    Posts
    1,242

    XHTML errors on server

    Alright.
    I have moved back into web development, after quiet some time off.
    I have been learning CSS properly as well as XHTML strict.
    Well it has been going well, XHTML was extreamly easy except when I uploaded it to my site.

    http://www.zacrifice.com/site/index.html

    I keep getting this error.
    can anyone tell me why?

    here is what the index.html contains

    http://www.zacrifice.com/site/index.txt
    All opinions are the result of being uninformed, unintelligent and uninterested!

  2. #2
    || $name ne 'R.Stiltskin'
    Join Date
    Jun 2003
    Location
    Tejas
    Posts
    2,438
    Hmm. The DOCTYPE definition looks OK for strict. One thing you might try would be the following as header:
    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xml:lang="en">
    Granted, this is XHTML 1.1 compliant and not 1.0, but it is by definition "strict" in order to validate to 1.1, so it should serve as a suitable debugging header.

    My guess is that "strict" is requiring you to include the xml declaration (see green code in above) and the parser is probably choking on that. I've never seen that T_STRING error before, but the fact that it is the very first line suggests to me that the doctype demands the xml declarative. The encoding can be any of several options, but the xml version MUST be included to validate properly. And don't forget the question marks, either.

  3. #3
    Histerical, absolute
    Join Date
    Aug 2002
    Posts
    1,242
    Spathiphyllum, I did originally have the tag
    <?xml version="1.0" encoding="iso-8859-1"?>
    in the file, but I was still getting the error so I removed it hoping that might be the problem and never put it back.
    I'll do that now!
    All opinions are the result of being uninformed, unintelligent and uninterested!

  4. #4
    Histerical, absolute
    Join Date
    Aug 2002
    Posts
    1,242
    eh, still the same error.

    The file will display perfectly in my browser from my hard drive but for some reason it just wont happen from the browser.

    Do you think it would be worth while opening a ticket?
    considering this is coming from the server and not the browser?
    All opinions are the result of being uninformed, unintelligent and uninterested!

  5. #5
    || $name ne 'R.Stiltskin'
    Join Date
    Jun 2003
    Location
    Tejas
    Posts
    2,438
    Curious, Zacrifice. A static xHTML page uploaded in ASCII should not have any parse issues. I did a quick search for T_STRING, and the vast majority of pages reporting errors dealt with PHP processed files where something was missing or the code was munged.

    Your code looks fine except for some idiosyncracies/preferences on spacing. To confirm, I ran your xHTML through HTML Tidy and no errors were detected though the format was tweaked a bit. Either way your code was properly nested and should render properly.

    Before opening a ticket, I'd try uploading the file again and Shift+Reload the page to get a fresh copy. If that doesn't work, then I might suspect you were getting a FileNotFound Error from one of the embedded images. The page might actually be calling a "lost" file and the error from the server is really the server trying to send you a 404 response and the response is actually getting screwed up and not your xHTML file. Are you using any PHP or scripting engine to produce ErrorDocuments dynamically?

    If not, and the page still won't render, I'd say send a ticket to see if the techs would know. Maybe someone else has experienced this and will chime in shortly.

  6. #6
    Histerical, absolute
    Join Date
    Aug 2002
    Posts
    1,242
    I did what you recommended and even uploaded everything including images and the css file making sure I manually setting the transfer type but nudda!

    I cleared my cache, rebooted my computer, absolutely everything I could think of!
    Nudda.

    I will open a ticket to support and see if there is anything up with the server, or something I'm missing!
    All opinions are the result of being uninformed, unintelligent and uninterested!

  7. #7
    Histerical, absolute
    Join Date
    Aug 2002
    Posts
    1,242
    A little update.
    I uploaded it too a friends server and it works perfectly and validates as strict XHTML.

    So its the server, I have submitted a ticket after not getting any luck playing with things my self.
    All opinions are the result of being uninformed, unintelligent and uninterested!

  8. #8
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    Do you have your account set up to parse .html files as PHP? The parse error is a PHP error, so I suspect you once set this up in CPanel.

    The reason why you are getting the error is because the short tags setting is on for PHP, which lets you use "<?" instead of "<?php" to open PHP code blocks. Since the XML declaration starts with a "<?" and the server is trying to parse the file as PHP, the PHP interpreter thinks that the XML declaration contains PHP code. It can't parse it, however, so it throws the error.

    To fix this either stop parsing HTML files as PHP or turn off PHP short tags with the following .htaccess directive:
    Code:
    php_flag short_open_tag 0
    Both of these will change the setting globally for the site (or the directory where you set it and may break other scripts on your site. To turn off the short tags on a single file, try adding this as the first line of the file (before the XML declaration:
    PHP Code:
    <?php ini_set('short_open_tags'false?>
    I don't know for sure that the latter suggestion will work.[*] Turn off
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  9. #9
    Histerical, absolute
    Join Date
    Aug 2002
    Posts
    1,242
    I'm gonna screem

    I looked in the mime types and there are no php mime's for html files!

    I would use the php_flag short_open_tag 0 but I use wordpress and it could stop it from working and this is suppose to be a test for a theme (not nearly finished at this point) to see how it all looks and works (not working with wp yet)

    This is bloody frustrating!
    All opinions are the result of being uninformed, unintelligent and uninterested!

  10. #10
    || $name ne 'R.Stiltskin'
    Join Date
    Jun 2003
    Location
    Tejas
    Posts
    2,438
    Just checked the page again and it is rendering from here now. I noticed you used "utf-8" and added some script for PrivoxyWindowOpen outside the body tags.

    Whatever the case for your changes, the page does appear without error. Just thought I'd confirm the current status to let you know that you may have resolved the issue.

  11. #11
    Histerical, absolute
    Join Date
    Aug 2002
    Posts
    1,242
    Alright, I did it.
    I put php_flag short_open_tag 0 in the .htaccess file and it fixed it and word press is working.
    I haven't done extensive testing but it seems to be alright.

    huh, something so simple.
    How stupid.

    I owe you a head of hair because you just saved mine!!!!!!
    All opinions are the result of being uninformed, unintelligent and uninterested!

  12. #12
    Histerical, absolute
    Join Date
    Aug 2002
    Posts
    1,242
    and I am so pissed diddly ised!

    This is the responce I got from support!

    2006-03-07 / 23:06:20
    Hi Ben-
    I have checked, and found that this is syntax error. Sorry we donot support programming. Please contact with some vendor/developer to fix it.

    Let us know if you need further assistance.

    Regards,
    ******

    I am Oh so pissed for getting a cand responce to a none cand request for help!

    has anyone ever seen a html file get a server error when its just straight text and html tags? (no php)
    I am oh so pised!

    But thank you to both Spathiphyllum and Jason, I appreciate both of your help!!!
    All opinions are the result of being uninformed, unintelligent and uninterested!

  13. #13
    Histerical, absolute
    Join Date
    Aug 2002
    Posts
    1,242
    just so we know, I have uncommented the .htaccess line php_flag short_open_tag 0 for now while I test a few things and so forth.
    Should be uncommented shortly!
    All opinions are the result of being uninformed, unintelligent and uninterested!

  14. #14
    Histerical, absolute
    Join Date
    Aug 2002
    Posts
    1,242
    Quote Originally Posted by Spathiphyllum
    added some script for PrivoxyWindowOpen outside the body tags.
    That part of you post got me a little curios so I removed the commented line in the htaccess file and your right there is a javascript request.

    I never put that in there.
    The file hasn't changed since it was uploaded.
    it should look exactly like the index.txt file!!!

    I have no idea what the added javascript request does!
    All opinions are the result of being uninformed, unintelligent and uninterested!

  15. #15
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    Zacrifice,

    Word press and most of the other newer PHP apps are usually pretty good about not using the short opening tags in PHP. Basically anything decent that came out within the past few years (when following XHTML standards and using PHP to generate XML [as XHTML, RSS, etc.] became popular) uses the longer tags, in my experience. If you have any older scripts on your site you might have problems with the short tags setting.

    If you haven't already, check the Apache Handlers section of CPanel to make sure there is nothing that's making Apache treat .html as PHP in there.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

Page 1 of 2 12 LastLast

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
  •