title: Passing variables in PHP from one file to another
body: <p>So this is my code. Now how do I use $pubname in another file.</p>
  
  <pre><code>mysqli_select_db($connect,"membership");
  $retname = "select username from users where email='$globalname' limit 1";
  $rn = mysqli_query($connect,$retname) or die(mysqli_error($connect));
  $name = mysqli_fetch_array($rn);
      //connecting for mathcing username with fullname and displaying it
  $pubname = mysqli_real_escape_string($name['username']);
  
  include('profile.php');
  
  echo $pubname;
  </code></pre>
  
  <p>and also is this code secure? I did that...does not work yet.</p>