1

I want to paas some variables through URL but want to hide them so that users do not change the details. I am redirecting from one view to another through a URL;

JRoute::_('index.php?option=com_componentname&variable1=value1&variable2=value2')

I want in site users to see index.php?option=com_componentname

Please guide me the way to do so.

Thanks and Regards, Ruchika

1 Answer 1

0

Use STATE or SESSION itself directly to pass those values if you don't want to be changeable. Any data in URL can be manually changed. In URL you can only try to obscure data using Router of you component or/and encode them or use some sort of checksum to be sure that data wasn't changed.

Useful links:

4
  • Thank you for your response Arthur! I will use SEF URLs by router but it will be displayed in the url. I want to use Joomla user state variable , I even tried using but :( . Can you please give me any example of how can i attain this? And session i will keep this as the second option.
    – user5491
    Jul 13, 2015 at 12:35
  • Yes. That's why I recommend you to use SESSION to pass those variables from one page to another. You simple can't have and don't have those variables at once. Its technically impossible. Jul 13, 2015 at 12:37
  • great! thank you so much Arthur for you quick responses :)
    – user5491
    Jul 13, 2015 at 12:55
  • Use State is basically session variables just using context. Here you have example docs.joomla.org/How_to_use_user_state_variables Jul 13, 2015 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.