Well I don't know how easily I can explain something that's in a book I can't see that you have...
Essentially the form works as a two stage process:
Screen One: Has an HTML FORM in it. That FORM will have an action associated with it which will be a reference to screen you will be sent to when you 'submit' the form. There will be a button on the form that will have value and initiate a 'submit'.
This 'quick reply' section is one such form, with two different buttons on it, each will send a different value to the destination of the forum submit (I believe that's newreply.php.
So, inside your Screen One form will have to be variables that are set.
What you've shown us in code is the destination screen, i.e. 'screen two' of the form.
The variable $_POST['num'] is checking the variables that were posted by the submit of a form and checking for one called 'num' and using that value.
If you're not seeing any values on your output (as I can see you're not) it means those variables aren't getting set. 'sorted' would also appear to either be posted from the form or sent through in the URL as in:
http://www.domain.com/screenOne.php?sorted=yes
To get the variable 'sorted' from the command line you need to use $_GET['sorted'];
If you use $REQUEST you will pull out variables that are in $GET or $POST (or $COOKIE for that matter, but don't worry about that).
Anyway, the point is that your code is for running after the variables have been set from another page. So you need to make sure you're setting those variables before anything happens on this page.
Does that make sense? What book are you using?