title: Displaying form information with PHP classes
body: <p>I am trying to display the information put in a form. Here is my code that is messing me up:</p>
  
  <pre><code>&lt;?php
  //include the person class
  require ('objects/classes/person.class.php');
  
  $person = new Person();
  
  //set person attributes
  $person-&gt;first_name = $_POST["first_name"];
  $person-&gt;last_name = $_POST["last_name"];
  $full_name = $person-&gt;retrieve_full_name();
  //display the name
  echo "Your full name is " . $full_name  . ". &lt;br /&gt;";
  echo "Your first name is " . $person . ". &lt;br /&gt;";
  echo "Your last name is " . $person . ".";
  
  
  ?&gt;
  </code></pre>
  
  <p>This is my class code: 
      
  
  <pre><code>class Person {
  
  //private attributes
  private $first_name;
  private $last_name;
  
  //get function
  public function __get($name){
      return $this-&gt;$name;
  }
  //set function
  public function __set($name, $value){
      $this-&gt;$name=$value;    
  
  }
  
  public function retrieve_full_name(){
      return $full_name = $this-&gt;first_name . ' ' . $this-&gt;last_name;
  
  }
  }
  ?&gt;
  </code></pre>
  
  <p>I also get this error when submitted: 
  Your full name is www dddd. 
  Catchable fatal error: Object of class Person could not be converted to string in /home/gaddough/cit21500/exercises/objects/login.php on line 13</p>
  
  <p>I know its an easy fix somewhere but I can't figure it out Any help would be awesome!</p>