Links including "&"

Discussion in 'HTML & Website Design' started by Josh Inno, Dec 20, 2006.

  1. #1
    I am making a page, and in it I want to link to a pre-generated map by map-quest. This link includes the character "&" which is detected as a big problem by a validation tool I use. I seem to recall a tutorial that has a way to either say not to parse the "&" or add characters so that the parser will read it as "&" (similar to   being a blank space).
     
    Josh Inno, Dec 20, 2006 IP
  2. void

    void Peon

    Messages:
    119
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    &

    (for ampersand)
     
    void, Dec 20, 2006 IP
  3. ckim06

    ckim06 Peon

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This is a good table listing all the codes,
    alanwood.net/demos/ansi.html

    Sorry I can't link yet.
     
    ckim06, Dec 20, 2006 IP
  4. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #4
    if you create your URLs yourself using PHP
    then your php.ini should contain the configuration:
    if you have access to root - then it may belong typically into
    /etc/php5/apache2/php.ini

    else in the php.ini accessible by you

    ; The separator used in PHP generated URLs to separate arguments.
    ; Default is "&".
    arg_separator.output = "&"

    this will system wide or where ever you put your php.ini convert all ampersand as & to make the links fully w3.org compatible for code validation

    to always display all & as such
    otherwise if only one static URL needs to be adjusted - then follow the method above by void using &amp, instead of &
     
    hans, Dec 21, 2006 IP
  5. Josh Inno

    Josh Inno Guest

    Messages:
    1,623
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #5
    There's the problem, I forgot the ; after &amp (which was the code I had been trying). Thank you! And no, no auto-generated links yet I'm afraid. We just copied and pasted one from the browser address line and it has ampersands in there.
     
    Josh Inno, Dec 21, 2006 IP