title: How to pass a PHP variable to a link in the same page
body: <p>I am a newbie in programming and this might be very basic. (I searched in the internet but can't find the solution). </p>
  
  <p><strong>My case:</strong>
  In a HTML file, I am retrieving a url parameter by $_GET['s1'] and this is the code:</p>
  
  <pre><code>&lt;?php $username=$_GET['s1']; ?&gt;
  </code></pre>
  
  <p>I am successful in doing thing but what I need to do is to get the $username variable to be inside a link in the same page. </p>
  
  <p>This link is actually a button in the same page. Once clicked, it will take you to another page. and its code is as follow:</p>
  
  <pre><code>&lt;a href="http://www.mywebsite.com/AM/index.php/myusername_1 " id="btn_1_eed2a4ea6f9ab0ffcae6eced4295bd8e" class="css-button style-1"&gt;&lt;span class="text"&gt;BOOK&lt;/span&gt;&lt;span class="hover"&gt;&lt;/span&gt;&lt;span class="active"&gt;&lt;/span&gt;&lt;/a&gt;
  </code></pre>
  
  <p>I want to replace myusername in <a href="http://www.mywebsite.com/AM/index.php/myusername_1" rel="nofollow">http://www.mywebsite.com/AM/index.php/myusername_1</a>
  with $username.</p>
  
  <p>I might not be able to change the the button code as I am using a program called "optimizepress" to build this page. I can only insert the link of the button and insert a custom HTML or a shortcode anywhere in the page.</p>
  
  <p>This page is to be given to my affiliates and I don't want to insert every affiliate's unique link in his duplicate of this page. I just want my affiliates' links to get generated automatically.</p>
  
  <p>THANKS in advance</p>