Forums

Get Current URL in form data

designsedge 06 Jul, 2015
I have successfully pulled user data, now I need to pull the URL that the form is on.
(Same form multiple articles)
That way I know where it was submitted.
Cheers.

(Btw - checked faqs and searched the forum 'get uri' 'page url', etc)
GreyHead 07 Jul, 2015
Answer
Hi designsedge,

Please see the last suggestion from Prof Calculus.

Bob
designsedge 07 Jul, 2015
Thanks bob!

Was able to get it working using that page; however, this code produced a blank page (assuming some error)
<?php
$doc =& JFactory::getDocument();
?>
<input type='hidden' name='page_url' id='page_url' value='<?php echo $doc->getBase(); ?>' />


May be related to the Joomla version 3.3. Thanks!
GreyHead 07 Jul, 2015
Hi desgnsedge,

This version should be good for Joomla! 3
<?php
$jdoc = \JFactory::getDocument();
?>
<input type='hidden' name='page_url' id='page_url' value='<?php echo $jdoc->getBase(); ?>' />

Max used $doc for something else in CFv5 :-(

Bob

PS I updated the FAQ
This topic is locked and no more replies can be posted.