title: Passing a URL as a GET parameter in Javascript
body: <p>I am trying to make a bookmarklet that uses the user's current URL, kind of like the tinyURL bookmarklet that uses this javascript code</p>
  
  <pre><code>javascript:void(location.href='http://tinyurl.com/create.php?url='+location.href)
  </code></pre>
  
  <p>So I copied that same thing and made</p>
  
  <pre><code>javascript:void(location.href='http://mywebsite.com/create.php?url='+location.href)
  </code></pre>
  
  <p>Then I use:</p>
  
  <pre><code>$url=$_GET['url']; 
  </code></pre>
  
  <p>to retrieve it. The problem is, if I am on a url that already has some get style info in the url, it messes everything up.</p>
  
  <p>Example, If I am on:</p>
  
  <pre><code>http://www.google.ca/webhp?um=1&amp;hl=en&amp;safe=off
  </code></pre>
  
  <p>The '_GET' code sets $url to be</p>
  
  <pre><code>http://www.google.ca/webhp?um=1
  </code></pre>
  
  <p>So I think the info in google URL is messing up all of my URL parsing, I imagine I am doing something very incorrectly or someone has a very elegant solution for this. What should I do? please help</p>