可能是一个新手问题,但后来我正在学习:
在下面的代码中,我需要命名 $targetname 和 $imagelocation 来自传入的 $_POST 变量......我知道我无法按照我尝试的方式正确定义这些变量,但有点难过...... . 帮助任何人?
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->jsonRequestObject = json_encode( array( 'width'=>300, 'name'=>$this->targetName , 'image'=>$this->getImageAsBase64() , 'application_metadata'=>base64_encode($_POST['myfile']) , 'active_flag'=>1 ) );
$this->execPostNewTarget();
}
...