あなたは何を使うのですか?ラジオボタン?はいの場合は、ラジオ ボタン タグの上にフォーム タグを追加します。
これが例です
<form name = "yesno" action = "<?php site_url('check/yesorno') ?>" method = "post">
<input type = "radio" name = "yesorno" value = "yes" onclick = "this.form.submit()">Yes
<br>
<input type = "radio" name = "yesorno" value = "no" onclick = "this.form.submit">No
</form>
/*Note:
Form name = name of form
action = destionation url (site_url(yourController/yourFunction))
method = post/get
onclick = javascript event (will execute the code when user click)
this.form.submit() = javascript dom, means submit the your form when specified event executed*/
ajaxを使いたい場合のコード
//first->create the object
//for chrome, firefox, etc
if(window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
}
//fro ie, etc
else
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
//to get response from php
xmlhttp.onreadystatechange = function()
{
if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
//your code here
}
}
//open connection
xmlhttp.open("GET","../project_php/login.php",true);
xmlhttp.send();
/*Note:
GET -> method
2nd paramater(../project_php/login.php) -> destination url
3rd parameter -> true or false (use true!)
on "your code here" comment, add your code if response from php successfully received.
*/