Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-16-2006, 10:13 PM   #1
darnit
Confirmed User
 
Join Date: Jul 2001
Location: Teh Interweb
Posts: 2,439
Simple Redirect Script - Recommendations?

Hi,

Im seeking a free php based script that can covert outgoing links to something like this:

http://www.somedomain.com/target/?id=45

Anyone found a good one? This is low volume SE traffic so no need to handle massive volume

<disclaimer>

Yes ive googled the fuck out of it - just dont want to install some crap so looking for a tested one.

</disclaimer>

ablility to work over multiple domains a plus but not necessary

Thanks!
darnit is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-16-2006, 10:35 PM   #2
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
make a directory called "out" like yourserver.com/out/

in that folder make a file called link.txt

put your outgoing links seperated by "~" like this
http://site1.com~http://site2.com~http://site3.com

save this as index.php

Code:
<?php
$url = "link.txt";
$links = file_get_contents($url);
$link = explode('~',$links);
$go = $link[$out];
header("Location: $go"); 
?>

call it like http://yourserver.com/out/?out=2
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-16-2006, 11:19 PM   #3
Spud
Confirmed User
 
Join Date: Jul 2001
Location: Seattle
Posts: 340
Smokey! you kick ass
Spud is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-17-2006, 01:32 AM   #4
Dagwolf
President of Canada
 
Dagwolf's Avatar
 
Join Date: Sep 2003
Location: Leaving Hell, Entering Limbo
Posts: 23,141
Quote:
Originally Posted by Spud
Smokey! you kick ass
Yeah, I guess he kinda does sometimes.
__________________
Sleep well, and dream of large women.

Dagwolf is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-17-2006, 01:37 AM   #5
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
or to make it cleaner, you can do this

http://www.site1.com
http://www.site2.com

then use this modified version of his script
Code:
<?php
$url = "link.txt";
$links = file_get_contents($url);
$link = explode('\n',$links);
$go = $link[$out];
header("Location: $go"); 
?>
that uses the line break code as the explode instead of ~ which makes it easier to edit your file and add/delete links
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-17-2006, 01:54 AM   #6
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by SmokeyTheBear
make a directory called "out" like yourserver.com/out/

in that folder make a file called link.txt

put your outgoing links seperated by "~" like this
http://site1.com~http://site2.com~http://site3.com

save this as index.php

Code:
<?php
$url = "link.txt";
$links = file_get_contents($url);
$link = explode('~',$links);
$go = $link[$out];
header("Location: $go"); 
?>

call it like http://yourserver.com/out/?out=2
Register globals are the devil.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-17-2006, 02:54 AM   #7
Nookster
Confirmed IT Professional
 
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
Quote:
Originally Posted by mrkris
Register globals are the devil.
Code:
if (@ini_get('register_globals')) {
   foreach ($_REQUEST as $var_name => $void) {
      unset($$var_name);
   }
}
Nookster is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-17-2006, 02:57 AM   #8
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
You might also want to test for \r\n, FWIW.. edit that file in Mike-Rowe-Sawft Winders and that's going to be a very broken redirect script.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-17-2006, 11:36 AM   #9
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
or better yet

Code:
<?php
$link[1] = "http://www.site.com";
$link[2] = "http://www.site2.com";

$id = $_GET['id'];
header("location: " . $link[$id]);
?>
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.