I have a form within my page, and it uses a formmail script to send the contents of the form to an email. I would like one of the hidden elements within the form to contain the URL or Title of the page that the form was sent from. I am using the same form across many areas of the site by loading it as an include, however, currently the form has an area called subject, i would like this subject to be dynamic and copy either the URL or the text between the <title></title> tags so i know where it was sent from. Is this possible and can someone help please? I store all my php includes away from the webroot if that makes any difference? Thanks EXAMPLE OF CODE <input type="hidden" name="subject" value="DYNAMIC PHP HERE" /> Code (markup): I have tried things like this <?php getPageTitle(); ?> but my php doesn't stretch past <?php include
Superb thank you THT! Used the code below for anyone that's interested (it returns the URL). Thanks again <?php echo $_SERVER['REQUEST_URI']; ?> Code (markup):