title: How to share a dynamic link in PHP?
body: <p>I have a generated link in PHP that takes the user's ID and places it at the end of a referral link to track who refers who using a referral system.  Example of the link via php:</p>
  
  <pre><code>http://example.com/index.php?page=act/reg&amp;inv=$arrusr[0]
  </code></pre>
  
  <p>I'm trying to create a share button for facebook, twitter, email, and even add a <code>shortener</code> using <code>bitly api</code> - but I keep running into the same problem... it will not update the user ID, and instead literally send the URL as is.</p>
  
  <p>I'm obviously doing something very stupid.  Any help is greatly appreciated.</p>
  
  <p>How the link is shared:</p>
  
  <pre><code>&lt;a class='btn btn-tw' href='https://twitter.com/home?status=http://example.com/test/index.php?page=act/reg&amp;inv=$arrusr[0]'&gt;&lt;i class='fa fa-2x fa-twitter twcolor'&gt;&lt;/i&gt;&lt;/a&gt;
  </code></pre>
  
  <p>The link works as is.  If I want to just create a simple link, it will give me something like this for example (depending on the user of course): </p>
  
  <pre><code>http://example.com/index.php?page=act/reg&amp;inv=43
  </code></pre>
  
  <p>How come, when I use a facebook, twitter, or bitly api share link it refuses to populate the user id on the end of the url?</p>
  
  <p>Any help is greatly appreciated!!!</p>
  
  <p>EDIT (full php code that isn't working)</p>
  
  <pre><code>&lt;?php
  
  echo "
          &lt;div class='row'&gt;&lt;!-- start of row text --&gt;
              &lt;div class='col-md-4'&gt;
                  &lt;center&gt;&lt;img src='image/logo.png' alt='Logo' class='img-circle img-responsive logo-size' style='max-height:275px;'&gt;&lt;/center&gt;
                  &lt;div id='DateCountdown' class='img-responsive' data-date='2014-11-01 04:05:00'&gt;&lt;/div&gt;&lt;br /&gt;
             &lt;/div&gt;
             &lt;div class='col-md-8 welcome-bar'&gt;
                  &lt;img src='image/thankyoubanner.png' alt='Thank you for signing up' class='img-responsive'&gt;
                  &lt;h2&gt;Invite friends and&lt;br /&gt;win more prizes!&lt;/h2&gt;
                              &lt;p align='center'&gt;Share this unique link via email, facebook or twitter and win more prizes as each friend signs up.&lt;/p&gt;
                              &lt;center&gt;&lt;form role='form'&gt;
                              &lt;input class='form-control' id='focusedInput' type='text' value='http://example.com/index.php?page=act/reg&amp;inv=$arrusr[0]' style='max-width:375px;text-align:center;'&gt;
                              &lt;/form&gt;&lt;/center&gt;
                              &lt;a class='btn btn-fb' href=http://www.facebook.com/sharer/sharer.php?u=http://example.com/index.php?page=act/reg&amp;inv=$arrusr[0]'&gt;&lt;i class='fa fa-2x fa-facebook fbcolor'&gt;&lt;/i&gt;&lt;/a&gt;
                              &lt;a class='btn btn-em' data-toggle='modal' data-target='#subscribe'&gt;&lt;i class='fa fa-2x fa-envelope-o emcolor'&gt;&lt;/i&gt;&lt;/a&gt;
                              &lt;a class='btn btn-tw' href='https://twitter.com/home?status=http://example.com/index.php?page=act/reg&amp;inv=$arrusr[0]'&gt;&lt;i class='fa fa-2x fa-twitter twcolor'&gt;&lt;/i&gt;&lt;/a&gt;
  
             &lt;/div&gt;
          &lt;/div&gt;&lt;!-- end of row countdown --&gt;
  
  ";
  ?&gt;
  </code></pre>
  
  <p>This php is a little box that is correctly generating a copy code (using bootstrap framework), and then the share links that are currently not operating.  (ignore the email link as that's a modal correctly working)</p>