Jamespotter:
Your example is fine, but you should refer the post vars using the $_POST array.
In the new versions of PHP, well since 4.1, PHP is set by default to not convert the form vars to $varname. You should use $_POST["varname"] or $_GET["varname"] (depending of the...