Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2008-10-13, 08:33 PM   #1
A.J. Angel
And Lord, we are especially thankful for nuclear power, the cleanest, safest
energy source there is. Except for solar, which is just a pipe dream
 
Join Date: Sep 2008
Posts: 229
Need some PHP help

Hey there,

I need some help from someone who is good in PHP. Currently, I am using the following code to hide my affiliate links:

PHP Code:
<?php

$path 
= array(

    
"amateursgonebad"    =>    "http://www.amateursgonebad.com/t1/revs=exquisiteangelz/",
    
"glamourmodelsgonebad"    =>    "http://www.glamourmodelsgonebad.com/t1/revs=exquisiteangelz/"

    
);

if (
array_key_exists($_GET["id"], $path))
    
header("location: " $path[$_GET["id"]]);

?>
Now, considering that the files which contains the code is called "index.php" and that it is located in a subdirectory called "redirect", how may I redirect surfers that go to the file in question directly (ie. "http://www.domain.com/redirect/index.php") be redirected back to my homepage while still being able to use the code above to hide my affiliate links? Any ideas or indications would greatly appreciated. Thanks!

Last edited by A.J. Angel; 2008-10-13 at 08:40 PM..
A.J. Angel is offline   Reply With Quote
Old 2008-10-13, 08:57 PM   #2
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
Code:
if (array_key_exists($_GET["id"], $path)) {
    header("location: " . $path[$_GET["id"]]); 
} else {
  header("location: http://yoursite.com/"); 
}
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2008-10-13, 09:16 PM   #3
A.J. Angel
And Lord, we are especially thankful for nuclear power, the cleanest, safest
energy source there is. Except for solar, which is just a pipe dream
 
Join Date: Sep 2008
Posts: 229
Much thanks to you CD!
A.J. Angel is offline   Reply With Quote
Reply


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 05:46 AM.


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