How I can capture previous and current URL to a hidden form field I need to create a hidden form field and populate the previous and current URL can someone tell me how I can do that in Craft.
In the context of Craft 3,

&lt;input type="hidden" name="referrerUrl" value="{{ craft.app.request.getReferrer()" /&gt;

&lt;input type="hidden" name="currentUrl" value="{{ craft.app.request.getAbsoluteUrl() }}" /&gt;


You can see other methods off of the web/Request object you can use here: https://docs.craftcms.com/api/v3/craft-web-request.html