Ok so I know how to get an external php file and display it after the button is clicked. However now I want to try and pick a certain function from that php file, is this possible?
This is my index.php
<script>
function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("POST","test.php",true;
xmlhttp.send(null);
}
</script>
<button type="button" onclick="loadXMLDoc()">Load results</button>
<div id="myDiv"></div>
and this is my external php page. test.php
<?php
function show() {
}
?>
<?php
function update() {
}
?>
<?php
function delete() {
}
?>