<?
require('wax.php');

handle_wax_call(new wax_functions());

class 
wax_functions {
    function 
add($a$b){
        return 
"setHTML('output', '" . ($a $b) . "');"// Stupid PHP needs the braces around $a and $b... that one was fun to debug
    
}
}
?>
<html><head><title>Simple wax Page</title>
<script src="wax_common.js"></script>
<script>
<? echo wax_script('wax_functions'); ?>
</script>
</head>
<body>
The simplest wax page.
<p>
<input type="text" name="a" value="1"> + <input type="text" name="b" value="1"> = <span id="output">?</span><br>
<button onClick="add(val('a'), val('b'));">Add</button>
</p>
<a href="simple.phps">The source code!</a>
</body>
</html>