Jump to content

how to put this variable in js?


victormenezes

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/286634-how-to-put-this-variable-in-js/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.