Results 1 to 4 of 4

Thread: PHP session id added to links messing up xhtml strict requirements

  1. #1
    Join Date
    Jun 2004
    Posts
    296
    Rep Power
    0

    Default PHP session id added to links messing up xhtml strict requirements

    why make my documents xhtml strict? Dunno? But i want to see if i can! The problem is that xhtml requires that links use the & instead of just & when building query strings for links.

    Invalid xhtml strict
    Code:
    <a href="http://example.com/foo.php?d=1&b=3"></a>
    Valid xhtml strict
    Code:
    <a href="http://example.com/foo.php?d=1&amp;b=3></a>
    I generate nice xhtml links but then php goes ahead and adds &PHPSESSID=<sess id> and messes up my mark-up. I know i can turn off this behaviour cept if i do the session wont work with browsers not using cookies. NE ideas on how i can generate this tag ending in a convenient manner for the sake of cookie-less browsers?

    So far i think i might have to turn off session url adding thingie and then use the func session_id() to create my links. sounds like a lot of work when you have alot of links tho.

  2. #2
    Join Date
    Feb 2003
    Posts
    3,184
    Rep Power
    0

    Default

    Check the php.ini there are some settings for the &PHPSESSID=<sess id> you might be able to tweek it to your will.

  3. #3
    Join Date
    Jun 2004
    Posts
    296
    Rep Power
    0

    Default

    you can set url_rewriter.tags to '' to to make sure that links dont get rewritten

  4. #4
    Join Date
    Jun 2004
    Posts
    296
    Rep Power
    0

    Default

    Code:
    ini_set(’arg_separator.input’,'&amp;’);
    is what i was looking for, when it rewrites links now it use &amp; instead of & which is exactly what i wanted.

Posting Permissions

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