Forums

Submition page URL to email

anonaki 05 Apr, 2011
Hello.

I've made a simple form asking for name, your email, friends email and a subject. When I click submit an email goes to the mail of the friend. Everything's ok through there.....

I wanted to include on this email the link to the page which the submision made.

All this in order to create a "recommend this page to a friend" form...

Any help??


P.S. Sorry for my English, hope you'll understand....
GreyHead 06 Apr, 2011
Hi anonaki ,

I think that you can do this by adding a hidden input to your form a little code in the Form HTML
<?php
$uri =& JFactory::getURI();
?>
. . .
<input type='hidden' name='uri' id='uri' value='<?php echo $uri->toString(); ?>' /> 


Bob
Quel 18 Apr, 2011
Hi all,

I'm trying to accomplish something similar where we have a "Request A Quote" form at the bottom of all our pages but would like to know what page the user was on when they decided to fill out the form. I'd like to include a hidden field that prints the page url in the email results.

I tried the above code by copy and pasting it into the Form HTML box just before the submit button code but got an error page when trying to save it in the backend.

This is what I pasted:

<?php
$url =& JFactory::getURI();
?>
<input type='hidden' name='uri' id='uri' value='<?php echo $uri->toString(); ?>' />


Is the first snippet of code supposed to go at the top of the Form HTML box or somewhere else in in the form admin panel?

Any suggestions would be appreciated!

Thanks!
GreyHead 18 Apr, 2011
Hi Quel,

There's a typo in my post. It should be $uri (or $url) in both lines. I'll go ack and fix my original post.

Bob
This topic is locked and no more replies can be posted.