このパラメーターを取得するには、まずDrupalでページ(URL)を作成する必要があります。これを行うhook_menu()
には、カスタムモジュールにを実装します。カスタムモジュールを作成するには、これを参照してください。
function MYMODULE_menu() {
$items['get_details'] = array (
'title' => '',
'page callback' => 'MYMODULE_access_variables',
'page arguments' => array(1),
'access callback' => TRUE, // this will be accessible to everyone
);
return $items;
}
function MYMODULE_access_variables() {
// Here you get access to the POSTED variables using $_RESPONSE php superglobal
echo "<pre>";
print_r ($_RESPONSE['title']); // will get you the value of the HTML input type having name='title'
echo "</pre>"
}
これにより、http://mydrupalsite.com/get_detailsのサイトにページが作成されます
今、あなたのHTMLから次のような呼び出しを行います
<form action="mydrupalcite.com/get_details" method="post">
<input type="text" name="title" /> <!-- Note that the value of the attribute 'name' will be used the capture the value which is posted -->
</form>
注: @cliveの回答に従って、開発/教育目的でのみ使用することをお勧めします。これはセキュリティに影響を与える可能性があります。