Results 1 to 5 of 5

Thread: "&" character through "get"

  1. #1
    Join Date
    May 2005
    Location
    France
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default "&" character through "get"

    Hi,
    Here is my link :<a href="popup.php?type=bracelets&image=106-e.jpg&description=Turquoise, malachite, horlite & fresh water pearls ">

    I want the "&" in description to be recognized as text and not as a variable separator. I tried htmlentities("&") but I can't get the &amp in my rsult page.
    The only thing that I have is "Turquoise, malachite, horlite ".

    Is there a solution ?

    Thanks

    Bernard

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by bernard
    <a href="popup.php?type=bracelets&image=106-e.jpg&description=Turquoise, malachite, horlite & fresh water pearls ">
    The ampersands that are separators should be included as &amp;. The ampersands that are characters should be included as %26, which is the ASCII value in hexadecimal. The urlencode function will do the latter for you.

    Mike

  3. #3
    Join Date
    May 2005
    Location
    France
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It works !!!!!
    I used urlencode and the link is OK

    Thanks

  4. #4
    Join Date
    Nov 2004
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I just want to express my thanks to mwinter!

    I had a similar problem before and now I found out (and learned) how to fix it.

  5. #5
    Join Date
    Jun 2005
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    try also $_SERVER['QUERY_STRING'] , have a nice experiment

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
  •