Que24.php-
<?php
$n1=$_GET['num1'];
$n2=$_GET['num2'];
$add=$n1+$n2;
echo "Addition Is:" .$add;
?>
1.html-
<html>
<head>
<script type="text/javascript">
function Addition()
{
var ob=false;
ob=new XMLHttpRequest();
var no1=document.getElementById("no1").value;
var no2=document.getElementById("no2").value;
ob.open("GET","Que24.php?num1="+no1+"&num2="+no2);
ob.send();
ob.onreadystatechange=function()
{
if(ob.readyState==4 && ob.status==200)
document.getElementById("add").innerHTML=ob.responseText;
}
}
</script>
</head>
<body>
Enter 1st No :<input type=text id="no1">
Enter 2nd no:<input type=text id="no2">
<input type=button name=submit value=add onClick="Addition()">
<span id="add"></span>
<body>
</html>