Save PageURL ONload

Save the current page URL in a ChronoForms database field on page load.

Overview

The user attempted to use incorrect PHP code in a CF event to capture and store the URL.
Use the correct PHP code in the appropriate CF event to assign the URL to a form data variable, which will then be saved to the database.

Answered
gu guillome 31 Oct, 2014
Is it possible to save the PageURL onload in another dbsave event?
I would like to save the page url on every single page load and I have put this custom code into onload, after render and before dbsave:

<?php echo 'page_url'=substr(JURI::getInstance()->toString(),-5,5); ?>

but it is not doing anything. I would like to store the value into page_url db field.

thanks
Max_admin Max_admin 31 Oct, 2014
Answer
Then it should be:
<?php $form->data['page_url'] = substr(JURI::getInstance()->toString(),-5,5); ?>

And that will save the last 5 characters only!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.