You don’t say whether you are using Revo or Evo...
The following are Revo tags, Evo is similar I’m sure - you can look it up if you need to.
Either way you do not need any php code.
You could just use [[*id]] or [[~[[*id]]]] in the form - in a hidden field or whatever - a hidden field might be a good idea so that the user is less likely to mess with this input, used in the subject line of an email as I show below the user might erase ’your’ subject and create their own; do both perhaps.
[[*id]] would give the id of the form page
if FURLs are on [[~[[*id]]]] will give you the URL without the base of the form page
for example
put this code on the page: mysite.com/contact.html
and when clicked the user will get an email with the subject: from-contact.html