If
SSI is enabled on your machine, you might be able to do something like this:
<input type="hidden" name="lastpage" value="<!--#echo var="REQUEST_URI
+" -->">
I don't have SSI enabled so I can't test the syntax, but I think that'll work. The only thing I'm not sure about is the nested double-quotes.
---
It's all fine and dandy until someone has to look at the code.