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 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 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. 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. 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
Archived
This topic is now archived and is closed to further replies.