title: How to change contact form 7 Redirecting URL dynamically - WordPress
body: <p>I am building a website for one of my clients and they want a function into their website some thing like the following: </p>
  
  <p>when people click the download link, a form will appear ( contact form 7) and after visitors put their details , it will re-directed to the download link.</p>
  
  <p>I able to re-direct to a new page after form submission by using following additional setting to the contact form 7.</p>
  
  <pre><code>on_sent_ok: "location = 'http://example.com/';"
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/4K4VM.png" alt="enter image description here"></p>
  
  <p>However, They have 10 files , I need to change the re-direction link 10 times to trigger the download for the appropriate file. I can do it by using 10 contact forms which will be very dirty.</p>
  
  <p><strong>Is there any way i can change the re-direction URL dynamically?</strong></p>
  
  <p>For example,</p>
  
  <pre><code>http://example.com/?id=1
  http://example.com/?id=2
  
  &lt;?php
  
  $id = $_GET['id'];
  
  $url= "http://example.com/id=?". $id; 
  
  
  ?&gt;
  </code></pre>
  
  <p>is there any way to change the following Location with $url ?</p>
  
  <pre><code>on_sent_ok: "location = 'http://example.com/';"
  </code></pre>