the code you reference is the form that you would have created, the download code is placed in the head of the php file.
to help troubleshoot. open the bindings panel (Window -> Bindings) and expand the WA Downloaded File binding group.
add the bindings from this section to your page for troubleshooting information. if you need further assistance, send a copy of the page, and the output of the bindings after trying a test.