title: Redirect User to encoded URL-Variable
body: <p>I am currently working on a URL, which encodes the URL entered by URL variable. The user is then redirected to <code>http://example.net/?enc_url=THE ENCODED LINK</code>.</p>
  
  <p>This is my previous code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;script type="text/javascript"&gt;
          setTimeout(function() {
              var uri = &lt;?php echo $_GET["url"]; ?&gt;
              var res = encodeURI(uri)
              location.href = 'http://example.com"/?enc_url={$res}'
          }
      &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Please help me, but remember that I do not have much experience with PHP yet. Thanks for any help!</p>
  
  <p>Greetings!</p>