I have a php script which are able to power on my computers at home using WoL, then check connectivity of the target machine and output a status.
I'm trying to make a nice webpage for that, where I can press a 'power on' link/button, where it then runs the formentioned script and shows the status right next to the 'power on' button.
I have been told to use AJAX, but can't get it to show anything.
My index.php:
<html>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>WOL</title>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">
function doSomething() {
$.get("status1.php");
}
</script>
<?php
echo "10.0.0.20 roadrunner ";
echo '<a href="#" onclick="doSomething()">power on</a>';
?>
</html>
The stautus1.php ends with
<?php
echo htmlheader();
echo htmlcontent();
?>
I probably should mention I'm very new with JS and also somewhat new at php.
What am I doing wrong?