[attachment=2]Schermata 2014-09-08 alle 15.47.25.png[/attachment]Hi everybody,
i'm working on a website i didn't build, and i'm trying to make forms work.
I don't know why, but some time ago we have a form that keeps the $page_name parameter and set it on the db along with the form data, now it doesn't work.
In the form there is a hidden field, you can see the attachment: the field_id is pagina_prov, without a default value
[attachment=0]Schermata 2014-09-08 alle 15.42.04.png[/attachment]
In the events tab, before the db_save, there is a custom code:
<?php
$form->data['pagina_prov'] = $page_name;
?>
[attachment=1]Schermata 2014-09-08 alle 15.44.19.png[/attachment]
And this is the db_save:
[attachment=2]Schermata 2014-09-08 alle 15.47.25.png[/attachment]
Any hint?
Thanks,
Lucio
i'm working on a website i didn't build, and i'm trying to make forms work.
I don't know why, but some time ago we have a form that keeps the $page_name parameter and set it on the db along with the form data, now it doesn't work.
In the form there is a hidden field, you can see the attachment: the field_id is pagina_prov, without a default value
[attachment=0]Schermata 2014-09-08 alle 15.42.04.png[/attachment]
In the events tab, before the db_save, there is a custom code:
<?php
$form->data['pagina_prov'] = $page_name;
?>
[attachment=1]Schermata 2014-09-08 alle 15.44.19.png[/attachment]
And this is the db_save:
[attachment=2]Schermata 2014-09-08 alle 15.47.25.png[/attachment]
Any hint?
Thanks,
Lucio
Hi Lucio,
But where is the "$page_name" variable set ?
Regards,
Max
But where is the "$page_name" variable set ?
Regards,
Max
Hi Max, thanks for your response. I solved, the problem was related to a joomla version change, and the variable $page_name was not available anymore. So i hade to put in the hidden field something different:
Thanks a lot,
Lucio
<?php
$doc =& JFactory::getDocument();
$mytitle = $doc->getTitle();
$form->data['pagina_prov'] = $mytitle;
?>
Thanks a lot,
Lucio
Thanks Bob. How can I get only the URL, not the page title or article title?
Hi Guillome,
Just use the first example in the FAQ which gets the URL and ignore the rest.
Bob
Just use the first example in the FAQ which gets the URL and ignore the rest.
Bob
Thanks, it works partly, it only stored the url until index.php but my complete url is:
index.php?option=com_chronoforms5&chronoform=chrono_test
can I store the info after "?" as well?
thanks
index.php?option=com_chronoforms5&chronoform=chrono_test
can I store the info after "?" as well?
thanks
You may also try this code:
Let us know if it works ?
<?php echo \GCore\Libs\Url::current(); ?>
Let us know if it works ?
I solved it. This is the solution:
<input type='hidden' name='page_url' id='page_url' value='<?php echo JURI::getInstance()->toString(); ?>' />
<input type='hidden' name='page_url' id='page_url' value='<?php echo JURI::getInstance()->toString(); ?>' />
Hi Guillome.
Well done, thank you - I have updated the FAQ to use that code.
Bob
Well done, thank you - I have updated the FAQ to use that code.
Bob
Do you know how to get the right 5 characters of that url and store only that?
use the PHP substr function:
substr(JURI::getInstance()->toString(), -5, 5);
These are all PHP questions, please search Google or our forums and you should find quick answers!
Regards,
Max
P.S: the IP of the visitor can be automatically included in the email, you can enable this in the Email settings!
Regards,
Max
P.S: the IP of the visitor can be automatically included in the email, you can enable this in the Email settings!
This topic is locked and no more replies can be posted.