WordPress
以下を参考にした。
https://qiita.com/KazuyoshiGoto/items/3789000f224aa89f8a56
https://www.webmd.com/
- WordPressの固定ページなどにフォームを設置する
<form action="./x" method="post"> <label><input name="s[]" type="checkbox" value="1" />xx</label> <label><input name="s[]" type="checkbox" value="2" />xx</label> <input type="submit" value="送信" /></form>
- 移行先のページに適当なショートコードを設置する
[sc_receive]
- function.phpなどにショートコードを定義する関数を追加し、そこでPOSTされたデータを受け取る。
function receive_post() {
# 受け取ったデータを配列に格納する。
if(isset($_POST)){
print_r($ar_s);
$ar_s = $_POST['s'];
}
foreach ($ar_s as $value => $key ){
$sc .= $sc . $key . ":";
}
$sc = "<h3>" . $sc . "</h3>";
return $sc;
}
add_shortcode('sc_receive', 'receive_post');