코드 찾기 here 입력란을 PHP 스크립트에 게시하고 있습니다. 결과는 다음과 같습니다.NAME에 기반한 변수에 POST JSON을 자동 할당
data:{
"textfield": ["",""],
"dropdown": ["option1","option1"],
"siteTitle":"this is the site title",
"siteKey":"",
"siteurl":"",
"address1":"",
"address2":"",
"address3":"",
"landline":"",
"method":"addSite",
"small-input":"",
"medium-input":"",
"large-input":""
}
다음 필드를 사용하여 각 필드를 선택합니다.
$data = $_POST['data'];
$data =stripslashes($data);
$obj = json_decode($data);
$siteTitle = sanitize($obj->siteTitle);
if (!$siteTitle){echo json_encode(array("msg"=> "Site title missing"));break;}
마다 자동으로 게시 field
통해 단계와 name
에 따라 변수에 할당하는 PHP에서 방법이 있나요?
$array = json_decode($json, true);
extract($array);
을하지만이 작업을 수행하지 나에게 강력히가 하는 것이 좋습니다 보자 데자 VU 걱정되는 사람에 대한
, don't be.
기본적으로 다소 다른 보안 위험이있는 [register_globals] (http://php.net/manual/en/security.globals.php) 버전을 요구하고 있습니다. 나는 그 길로 가지 않을 것을 제안합니다. – Amber
아니요 :) ~ – AlienWebguy