Can somebody help me with a simple PHP questions please

hade

Registered Member
Joined
Jul 25, 2008
Messages
80
Reaction score
26
You can only do that by loading a page and using javascript to open the second window. Then you'd probably use javascript to redirect the main window too.
Posted via Mobile Device
 

rrorchid

Newbie
Joined
Oct 26, 2009
Messages
27
Reaction score
4
in hxxp://www.myaffiliatelink.com:

PHP:
<script type="text/javascript">
function open_win(thisurl)
{
window.open(thisurl,"_blank","resizable=yes)
}
</script>

 <body onload="open_win(nameofpageyouwanttoload)">
 

RumMonkey

Junior Member
Joined
Jan 8, 2009
Messages
149
Reaction score
229
thanks for that :)

But which part do i replace with affiliate link 1

and which do i replace with affiliate link 2?



in hxxp://www.myaffiliatelink.com:

PHP:
<script type="text/javascript">
function open_win(thisurl)
{
window.open(thisurl,"_blank","resizable=yes)
}
</script>

 <body onload="open_win(nameofpageyouwanttoload)">
 

goawayplease

Regular Member
Joined
Apr 10, 2008
Messages
321
Reaction score
70
You would use PHP to output that HTML to the screen, using PHP to set the URL in the body onload.


Something like
Code:
<?php
$id = $_GET['id'];

switch($id)
{
   case 0:
     $url = 'yourafflink0';
     break;

   case 1:
     $url = 'yourafflink1';
     break;

   default:
     $url = 'http://google.com'; // bad campaign, get them out of here
};

?>
<html>
<head>

<script type="text/javascript">
function open_win(thisurl)
{
window.open(thisurl,"_blank","resizable=yes)
}
</script>
</head>
 <body onload="open_win(<?php echo $url; ?>)"> 
</body>
</html>
 
Last edited:
Top