I have a an HTML button where I want the onclick to call a PHP function. I need to use AJAX to do this but I am totally lost. There is more that occurs inside the php function, but I didn't see the need of including it. Below is code thus far:
<HTML>
<BODY>
<FORM>
<input text="text" name=airport1 id=airport1 />
<input text="text" name=airport2 id=airport2 />
<input type="button" value="Enter" onclick=PrintDist()/>
</FORM>
</BODY>
</HTML>
<?php
function PrintDist(){
$icao1 = $_REQUEST["airport1"];
$icao2 = $_REQUEST["airport2"];
}
?>