Greenguy's Board


Go Back   Greenguy's Board > General Business Knowledge
Register FAQ Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 2005-08-01, 08:58 AM   #19
CelticTiger
Are you sure this is the Sci-Fi Convention? It's full of nerds!
 
CelticTiger's Avatar
 
Join Date: Feb 2004
Location: Ireland
Posts: 266
Send a message via ICQ to CelticTiger
It's not really necessary to go as far as using mod_rewrite in your .htaccess

Here's the code I like to use:
PHP Code:
<?php
switch($_GET['id'])
{
case(
'1'):
$location 'sponsor url here';
break;
case(
'2'):
$location 'sponsor url here';
break;
case(
'3'):
$location 'sponsor url here';
break;
default:
echo 
'Error: No ID Specified';
exit;
break;
}
header('Location: ' $location);
?>
Save as links.php or whatever you wish. Using categories like amateur-links.php for your amateur links etc is also helpful in keeping things organized. You can add more links as required by simply adding in :

PHP Code:
case('4'):
$location 'sponsor url here';
break; 
before the code
PHP Code:
default:
echo 
'Error: No ID Specified';
exit;
break; 
Just make sure you change the case numbers.


Upload the file to your server and
now you simply use: "links.php?id=1" ie

http://www.domain.com/links.php?id=1 where the id=1 represents
PHP Code:
case('1'):
$location 'sponsor url here'
Now for example if the sponsor/site in
PHP Code:
case('1'):
$location 'sponsor url here'
is performing badly or the sponsor goes under you can simply change the url to something else and your traffic is rerouted to another site.

Hope this helps.
CelticTiger is offline   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:32 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc