title: defining a class to call its function but it is not recognize and shows error
body: <p>1 .here is class for follow </p>
  
  <pre><code>class Follow extends User {
  protected $pdo;
  
  function __construct($pdo){
      $this-&gt;pdo = $pdo;
  }
  public function checkFollow($followerID, $user_id){
      $stmt = $this-&gt;pdo-&gt;prepare("SELECT * FROM `follow` WHERE `sender` = :user_id AND `receiver` = :followerID ");
      $stmt-&gt;bindParam(":user_id", $user_id, PDO::PARAM_INT);
      $stmt-&gt;bindParam(":followerID", $followerID, PDO::PARAM_INT);
      $stmt-&gt;execute();
      return $stmt-&gt;fetch(PDO::FETCH_ASSOC);
  }
  
  public function followBtn($profileID, $user_id){
      $data =$this-&gt;checkFollow($profileID, $user_id);
      if ($this-&gt;loggedIn()===true) {
  
          if ($profileID != $user_id) {
              if ($data['receiver'] == $profileID) {
                  //following btn
                  echo "&lt;button class='f-btn following-btn follow-btn' data-follow='".$profileID."'&gt;Following&lt;/button&gt;";
              }else{
                  //follow btn
                  echo "&lt;button class='f-btn following-btn follow-btn' data-follow='".$profileID."'&gt;&lt;i class='fa fa-user-plus'&gt;&lt;/i&gt;Follow&lt;/button&gt;";
  
              }
          }else{
              //edit button
                          echo "&lt;button class='f-btn' onclick=location.href='profileEdit.php'&gt;Edit&lt;/button&gt;";
  
          }
      }else{
          echo "&lt;button class='f-btn' onclick=location.href='index.php'&gt;&lt;i class='fa fa-user-plus'&gt;&lt;/i&gt;Follow&lt;/button&gt;";
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>2 . here is my code in html to call for the button if user not logged in</p>
  
  <pre><code> &lt;body&gt;
     &lt;div class="edit-button"&gt;
          &lt;span&gt;
              &lt;?php $getFromF-&gt;followBtn($profileId, $user_id); ?&gt;
          &lt;/span&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  </code></pre>
  
  <hr>
  
  <p>And it show these error 
  Notice: Undefined variable: getFromF in C:\xampp\htdocs\profile.php </p>
  
  <hr>