victormenezes Posted March 1, 2014 Share Posted March 1, 2014 (edited) I'm doing a protector of link, the link is hidden in this php variable <?=$url;?> this is the js code which generates a button for the person to continue. function getParam(_0xd83bx2){return(location['search']['match'](new RegExp(_0xd83bx2+'=([^?&=]+)'))||[])[1]||'';};var url_final=hexDecode(getParam('url'));if(url_final==false||url_final==''){var url_seguir='http://www.hostmp.net';}else{var url_seguir=url_final;};timer=10;ventana=null;n=5;aviso=false;function janelaTAFC(){ventana=window.open('http://meusite.com/anuncio/','PopUp','scrollbars=no,location=no,toolbar=no,status=no,menubar=no,directories=no,resizable=no,width=1000,height=400,left=50%,top=50%');$('a[name=btnDownload]')['remove']();$('input[name=imgDownload]')['before']('<input type="image" name="imgDownload" src="imagens/loading.gif" />','<a href="#" name="imgDownload" class="download_regular_disabled" id="spr" ></a>');timer=setInterval('tafc_contagem()',3000);};function tafc_contagem(){if(ventana!=null){if(ventana['closed']){alert('* Aten\xE7\xE3o! * \x0A\x0AVoc\xEA deve seguir as instru\xE7\xF5es .\x0A\x0ATente novamente.');clearInterval(timer);n=5;window.location.reload();};if(ventana['frames']['length']==3){return false;}else{n=n- 1;if(n==0){clearInterval(timer);$('input[name=imgDownload]')['remove']();$('a[name=imgDownload]')['remove']();$('a[name=efetuarDownload]')['before']('<a href="#" name="efetuarDownload" class="download_premium_but" id="efetuar"></a>');$('#efetuar')['click'](function(){window['location']=url_seguir;});};};};}; where ('<a href="#" name="efetuarDownload" class="download_premium_but" id="efetuar"></a>') is my final result. is possible in place of # put the php variable? I put a href in php page with display: none like this: <a href=<?=$url;?> name="efetuarDownload" class="download_premium_but" id="efetuar2" style="display:none" /></a> it works it is possible to get the url to efetuar2 and replace # efetuar? Edited March 1, 2014 by victormenezes Quote Link to comment https://forums.phpfreaks.com/topic/286634-how-to-put-this-variable-in-js/ 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.