Ampersands in urls

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wiert Dijkkamp

    Ampersands in urls

    My website uses sessions and therefore sends PHPSessionID's throug the url
    whenever a browser does not accept cookies. This works well except tha when
    i try to validate the webpage with W3C it complains about my url's having &
    which I should change in &. How can I tel my webserver to do that?
    url: http://www.kunstenschool.nl
    --
    wiert

  • David Dorward

    #2
    Re: Ampersands in urls

    Wiert Dijkkamp wrote:
    [color=blue]
    > My website uses sessions and therefore sends PHPSessionID's throug the url
    > whenever a browser does not accept cookies. This works well except tha
    > when i try to validate the webpage with W3C it complains about my url's
    > having & which I should change in &. How can I tel my webserver to do
    > that? url: http://www.kunstenschool.nl[/color]



    --
    David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is

    Comment

    • Wiert Dijkkamp

      #3
      Re: Ampersands in urls

      David Dorward wrote:
      [color=blue]
      > Wiert Dijkkamp wrote:
      >[color=green]
      >> My website uses sessions and therefore sends PHPSessionID's throug the
      >> url whenever a browser does not accept cookies. This works well except
      >> tha when i try to validate the webpage with W3C it complains about my
      >> url's having & which I should change in &amp;. How can I tel my webserver
      >> to do that? url: http://www.kunstenschool.nl[/color]
      >
      > http://www.w3.org/QA/2005/04/php-session
      >[/color]
      thanks a lot. I put "ini_set('arg_s eparator.output ','&amp;');" in my
      fix_code function like this an now it works.

      <?php
      $charset = "iso-8859-1";
      $mime = "text/html";

      function fix_code($buffe r) {
      ini_set('arg_se parator.output' ,'&amp;');
      $in = array(" />"," px;");
      $out= array(">","px;" );
      return (str_replace($i n, $out, $buffer));
      }
      ob_start("fix_c ode");
      $prolog_type = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01
      Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>

      <html lang='nl'>";

      header("Content-Type: $mime;charset=$ charset");
      print $prolog_type;
      ?>
      --
      wiert

      Comment

      Working...