hmsilveira Posted June 26, 2011 Share Posted June 26, 2011 Hi all, I'm a little bit confused how can i pass secure URl to javacript function. I have one javacript function to reload page and take one id: <script type="text/javascript"> function refresh_page(x) { //window.location.search="?parameter1=true¶meter2=6"; window.location.search="?id=" + document.getElementById(x).value; } </script> But now i would like to send the id variable encrypted with secure url class. I should make something like this: $secureurl = new secureurl; $secureurl->encodeURL('id=' . document.getElementById(x).value) Any ideas will be much appreciated. Thanks a lot. Looking forward for your answers. Hugo Quote Link to comment https://forums.phpfreaks.com/topic/240443-php-secure-url-javacript-reload-page-function/ Share on other sites More sharing options...
hmsilveira Posted June 26, 2011 Author Share Posted June 26, 2011 Any ideas? Thanks in advance. Regards Hugo Quote Link to comment https://forums.phpfreaks.com/topic/240443-php-secure-url-javacript-reload-page-function/#findComment-1235008 Share on other sites More sharing options...
wildteen88 Posted June 26, 2011 Share Posted June 26, 2011 You cannot use JavaScript within PHP code. PHP and JavaScript are execute at different times. You may want to look into using AJAX to send data to your PHP scripts. Quote Link to comment https://forums.phpfreaks.com/topic/240443-php-secure-url-javacript-reload-page-function/#findComment-1235009 Share on other sites More sharing options...
hmsilveira Posted June 26, 2011 Author Share Posted June 26, 2011 Ok. So what do you suggest to reload the same page, send one variable but encrypted with secure url class? can you give me a short example? Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/240443-php-secure-url-javacript-reload-page-function/#findComment-1235010 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.