「php入門」formのボタンで遷移先を変更するサンプル

JSコード
$('.cft’).click(function() {
$(this).parents('form’).attr('action’, $(this).data('action’));
$(this).parents('form’).submit();
});

phpコード
<form action="userReg.php" method="POST">
<button class="cft" data-action="userReg.php">登録</button>
</form>

PHP

Posted by arkgame