如果選擇html單選按鈕,是否可以調用php函數?使用html單選按鈕(或其他選項)在不使用javascript的情況下調用php函數
我正在爲一個小型非營利性學校建立一個捐贈頁面,該頁面將有三個選項:捐贈,支付學費或每月捐贈。
我想選擇單選按鈕來根據他們的選擇加載網頁的其餘部分。如果可能的話,我想在不使用javascript(如果用戶禁用)或iframe的情況下執行此操作。
目前,如果我使用JavaScript,它的工作原理與此代碼:
<html>
<head>
<script type="text/javascript">
function go (url) {
parent.frame_name.location = url;
}
</script>
</head>
<body>
I would like to:
<br />
<input type="radio" name="type" value="donate" onclick="go ('makedonate.php')">Make a Donation
<input type="radio" name="type" value="tuition" onclick="go ('paytuition.php')">Pay My Child's Tuition
<input type="radio" name="type" value="monthly" onclick="go ('makemonthly.php')">Become a Monthly Sponsor
<iframe name="frame_name" frameborder="0" width="600" height="300"></iframe>
</body>
</html>
這可能嗎?有什麼想法嗎?