SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    validation <a problem

    hi

    am having problem validating my xHTML 1.0 strict code in this section


    <p>some content<a href="read.php?article_name=Test 2">Read</a></p>
    error: <...> escaping malformed URI reference

    An URI contains non-authorized characters. Or the quotes around the URI are not closed.


    any help regarding this

    thanks
    Never be shy to ask silly Qs
    An answer is always better than none

  2. #2
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you please post the full XHTML source output? I'd be able to help you find it if I saw it. I'm asking because from what I have seen thus far, there should be NO errors popping up.

  3. #3
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    actually the code is a mix of xHTML and php.

    and true as far as i can see there is no problem with the code.!!

    give me a time
    Never be shy to ask silly Qs
    An answer is always better than none

  4. #4
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    solved

    the problem was in the validation program am using not the code i have validated it
    with W3C its valid

    am using an extention with FireFox its doing ok but not perfect.

    thanks for the help.
    Never be shy to ask silly Qs
    An answer is always better than none

  5. #5
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, the W3C validator doesn't check whether hrefs are valid URIs (because it's a simple DTD validator, and DTDs can't check that attributes are valid URIs).

    The href attribute must contain a valid URI. URIs can't contain spaces (see 2.4.3. in RFC 2396). Your markup snippet should look like this:
    Code:
    <p>some content<a href="read.php?article_name=Test%202">Read</a></p>
    Simon Pieters

  6. #6
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zcorpan
    No, the W3C validator doesn't check whether hrefs are valid URIs (because it's a simple DTD validator, and DTDs can't check that attributes are valid URIs).

    The href attribute must contain a valid URI. URIs can't contain spaces (see 2.4.3. in RFC 2396). Your markup snippet should look like this:
    Code:
    <p>some content<a href="read.php?article_name=Test%202">Read</a></p>
    How ironic that I didn't even notice the space between "Test" and "2" . Oh well, that's what a lack of sleep will do to anyone.

  7. #7
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the reply.
    now its a PHP problem more then HTML.
    because the article_name is fatched from the Data Base using PHP.
    now must find a way to convert spaces into %20.

    thanks everybody for the info.
    Never be shy to ask silly Qs
    An answer is always better than none

  8. #8
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    urlencode("Test 2"); // outputs "Test%202" 
    Simon Pieters


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
  •