2013-03-28 3 views
0

저는 mercury editor (non rails)로 내용 관리 시스템을 개발 중입니다. 하지만 문제는 수은 편집기에서 제공하는 JSON 문자열을 저장하는 방법을 모른다는 것입니다.mercury editor에서 PHP 데이터베이스로 저장하는 방법

다음은 편집기에서 제공하는 JSON 문자열입니다.

{ 
"get_title": { 
"type": "simple", 
"data": {}, 
"value": "skdhfzsd" 
}, 
"title": { 
"type": "simple", 
"data": {}, 
"value": "This is a test page" 
}, 
"content": { 
"type": "full", 
"data": {}, 
"value": "<p>What is this kind of page ?</p><p>Well this is my cool test page to try out different stuff.</p><p><a href=\"http://www.domeinz.nl\" target=\"_blank\">Woot</a></p><p><iframe style=\"width: 560px; height: 349px;\" src=\"http://www.youtube.com/embed/ixifxQ_MDu4?wmode=transparent\" frameborder=\"0\" allowfullscreen=\"true\"></iframe><br></p><p><iframe style=\"width: 400px; height: 225px;\" src=\"http://player.vimeo.com/video/22193086?title=1&byline=1&portrait=0&color=ffffff\" frameborder=\"0\"></iframe><br></p><p>☃ ©</p><p><br></p>", 
"snippets": {} 
} 
} 

문제점은 내 save.php 파일에 저장하는 방법과 요청을받는 방법을 모른다는 것입니다.

Greets wouter.

답변

0

이 json 문자열을 PHP 파일 (기본적으로 배열)로 보내야합니다.

PHP 파일은 정보를 처리하여 데이터베이스에 삽입 할 수 있습니다.

결과를 처리하는 방법에 대해 두려워하지 마십시오. print_r ($ _ GET) 또는 print_r ($ _ POST)을 수행하면 PHP 파일에서 편집기가 보내는 정확한 정보를 볼 수 있습니다.

PHP 파일은 다른 양식이 정보를 보내는 것과 똑같은 방식으로 정보를 처리해야합니다. 즉이 편집기의 아름다움입니다.