Search code examples
javascripthtmlurlampersand

ampersand not passing through url


On my site www.gibberize.com if you type in the word "and" in the top textarea, the character "&" will appear in the second textarea.

The problem is that the "tweet it" link will then append the second textarea's text to a url and proceed to the link, but because it is an ampersand it will break the text.

Any solutions?


Solution

  • Use PHP's urlencode() function.