title: HOW to get $_POST variable into my CLASS?
body: <p>Probably a newbie question, but then I'm learning on the fly:</p>
  
  <p>Within the following code, I need to name $targetname and $imagelocation come from the $_POST variable coming in... I KNOW I can't define these variables properly the way I'm trying to, but am a bit stumped... help anyone?</p>
  
  <pre><code>class PostNewTarget{
  
  //Server Keys
  private $access_key     = "123456";
  private $secret_key     = "142356";
  
  private $targetName     = $_POST['the_target'];
  private $imageLocation  = $_POST['the_image'];
  
  function PostNewTarget(){
  
      $this-&gt;jsonRequestObject = json_encode( array( 'width'=&gt;300, 'name'=&gt;$this-&gt;targetName , 'image'=&gt;$this-&gt;getImageAsBase64() , 'application_metadata'=&gt;base64_encode($_POST['myfile']) , 'active_flag'=&gt;1 ) );
  
      $this-&gt;execPostNewTarget();
  
  }
  ...
  </code></pre>