In your code you have not written anything to get the response from the php page.
I have made the changes in your javascript part which will return the value from the php page.
Kindly have a look at the below code. Hope this helps.
<html>
<head>
<script>
var art;
function radio(){
if (document.getElementById('r1').checked) {
art = document.getElementById('r1').value;
}
if (document.getElementById('r2').checked) {
art = document.getElementById('r2').value;
}
if (document.getElementById('r3').checked) {
art = document.getElementById('r3').value;
}
if (document.getElementById('r4').checked) {
art = document.getElementById('r4').value;
}
if (document.getElementById('r5').checked) {
art = document.getElementById('r5').value;
}
if (document.getElementById('r6').checked) {
art = document.getElementById('r6').value;}
sendart(art);
}
function sendart(t)
{
var xmlHttp;
try
{
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return;
}
}
}
xmlHttp.onreadystatechange=function()
{
if (xmlHttp.readyState==4 && xmlHttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlHttp.responseText;
}
}
xmlHttp.open("GET","test.php?art=" + t, true);
xmlHttp.send();
}
</head>
<body>
<form name = "form1">
<input id="r1" type="radio" value=Article name="radios" checked>
<input id="r2" type="radio" value=Book name="radios">
<input id="r3" type="radio"value=InBook name="radios">
<input id="r4" type="radio" value="Phd Thesis" name="radios">
<input id="r5" type="radio" value="Master's Thesis" name="radios">
<input id="r6" type="radio" value=Miscellaneous name="radios">
<button type=button onclick="radio();">Submit</button>
</form>
</body>
</html>