Well, firstly you're trying to include PHP in your HTML code, that's not how it works. What you should be doing is including HTML in your PHP. It sounds like I'm just being picky, but when you think about it that way round you'd be surprised how many problems can be figured out!
Basically, there are a few issues with the code as is. The values coming from $_POST are strings, not numbers, so you could do with using something like this on them:
$average = (floatval($_POST['number1']) + floatval($_POST['number2']) / 2;
Also, you can't use those values until they've actually been sent to the server (PHP is executed on the server, not in the browser) so you chould wrap the two lines of PHP code there in an if statement to check if they have been set or not:
if(isset($_POST['number1']) && isset($_POST['number2']))
{
$average = (floatval($_POST['number1']) + floatval($_POST['number2']) / 2;
echo $average;
}
Lastly, as you've not said exactly what was wrong (or even if you had any issue) I am assuming that you are seeing some output and that PHP is set up correctly on your server? If not, make sure to check several things: a) your server is set up for PHP & b) your script has a .php extension and not a .html one.