Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Transient SID invalidates my XHTML

    I already have an ini_set directive to make it use & for the argument separator, and that prevents XML parsing exceptions:
    PHP Code:
    ini_set("arg_separator.output","&"); 
    But when a page has forms, PHP inserts the hidden element as a direct child of <form>, which is not allowed - it should be inside a <fieldset>.

    What can I do about that - how can I control where hidden inputs are inserted?
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can achieve that effect by tweaking another configuration option:

    PHP Code:
    ini_set('url_rewriter.tags''a=href,area=href,frame=src,fieldset=fakeentry'); 
    Works for me with PHP 4.3.4. Older versions may not be that cooperative (see also the comments on http://bugs.php.net/bug.php?id=13472).

    I have to admit I never cared for this issue, as long as browsers ate the session code I threw at them. But I haven't used validating parsers on PHP-generated documents yet, so I shut my mouth now.
    De gustibus non est disputandum.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No exactly - I wasn't particularly concerned until I started throwing PHP-generated code at an XML parser

    Anyway ta - that works on my live server which runs 4.3.4 - doesn't work on my local server which is 4.2, but I can live without til I have the time to upgrade it.


    Cheers
    Last edited by brothercake; 01-23-2004 at 01:38 AM.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Sheffield, UK
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    to be safe when validating i completely turn off the url_rewriter_tags when the user agent matches that of the validator.

    you could also try form=action to have the SID appended onto the querystring in the action attr.
    "To be successful in IT you don't need to know everything - just where to find it in under 30 seconds"

    (Me Me Me Me Me Me Me Me Me)

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by ReadMe.txt
    to be safe when validating i completely turn off the url_rewriter_tags when the user agent matches that of the validator.
    Kinda defeats the purpose of validating, doesn't it?
    And what do you do if you want to use a validating parser on your PHP output?
    De gustibus non est disputandum.

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Sheffield, UK
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i dont agree. My code is valid - the cvode added automatically by PHP is not.

    The validator doesn't need a sesison sicne it only visits one page at a time, so i cant hurt to not give it the session ID
    "To be successful in IT you don't need to know everything - just where to find it in under 30 seconds"

    (Me Me Me Me Me Me Me Me Me)

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My point was that it doesn't help you to have valid markup that gets invalidated by PHP, if you think of a crawler that fetches the code directly from your site and tries to process it. It will choke on it. So how do you figure out now what clients will use your markup in the future?

    Probably a moot point since we know how to fix that issue anyway. But fixing only the output for the validator is IMO the wrong way to handle it.
    De gustibus non est disputandum.

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I agree - if you're gonna do that ... well ... you're just paying lip-service to the idea of validity.

    That's fair enough if those are your priorities - but you can't really call that valid code, more like "meta-valid" - it passes the validity test because it cheats.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark


  •  

    Posting Permissions

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