10th April 2015, 20:33
#11
5 out of 5 members found this post helpful.
O solutie luata de pe stackoverflow:
Cod PHP:
<script>
window.onload = function(){
try
{
if (window.parent && window.parent.location.hostname !== "w w w. abc . com"){
throw new Error();
}
}
catch (e){
window.top.location = "http: // w w w . xyz . com";
}
}
</script>
(Am rasfirat url-urile ca-s prea nou pe forul sa introduc links.)
Daca iti incarca pagina intr-un iframe, userul e trimis spre site-ul xyz (aici tu hotarasti unde).