Jump to content

Recommended Posts

ok topic is a bit cryptic 

 

I am working on a small charity project for a friend he raises funds for a charity via online auctions and raffles of donated items but we want to expand it to start with affiliate schemes gaining the donation without our users dipping there hands in there own pocket 

 

anyway

 

 

some of the affiliate links can be huge so I wanted to chop them down with out own redirect using an array

 

so the user input www.yoursite.com/?afflink=thesiteyouwant  and it auto redirects to the correct place

 

here is the code I have so far

<? 

if(isset($_GET['id'])) {

$page = $_GET['id'];


$link["g"] = www.google.co.uk;
$link["b"] = www.bing.com;
$link["f"] = www.facebook.com;

$name["g"] = google;
$name["b"] = bing;
$name["f"] = facebook;
?>
<html>
<head>
<script type="text/javascript">
<!--
function delayer(){
    window.location = "<? $link[$page] ; ?>"
}
//-->
</script>
</head>

<body onLoad="setTimeout('delayer()', 5000)">
<h2>Thankyou for your help</h2>
<p>Your Awesome!!!!<br>
You will be redirected to <? echo $name[$page] ; ?> in 5 Seconds<br><br>

If the page does not redirect you please click <a href="<? $link[$page] ; ?>">Here</a></p>

</body>
</html>
<?
} else {
?>

Main Site

<? } ?>

now this part (below) works correctly

You will be redirected to <? echo $name[$page] ; ?> in 5 Seconds

but the links will not load it just shows the link you entered to get there 

 

and yes I am a newb been a while since i had a play so playing catch up again now lol

 

as soon as I can get the links to load correct I will be on my way again

 

Thanx all

Edited by whare
Link to comment
https://forums.phpfreaks.com/topic/287154-external-url-in-array-for-auto-redirect/
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.