Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-02-2009, 04:53 PM   PM User | #1
bucket
Regular Coder

 
Join Date: Sep 2008
Posts: 688
Thanks: 8
Thanked 17 Times in 16 Posts
bucket is infamous around these parts
using redirect for outgoing links

Please can I get some help with this:

1. Setting up so that all external links use mywebsite.com/out?= or similar for all outgoing URLS by default.

2. Also, that page should take the user to a 'redirecting you page' and then onto the destination.

Thanks!
bucket is offline   Reply With Quote
Old 11-03-2009, 02:23 AM   PM User | #2
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,044
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
example:
mywebsite.com/out?=http://www.google.com

This has to be the "index.php" file in your case, because you didn't specify any file ...
PHP Code:
<?php
// default in case they don't enter any URL
$out="index.php";

// get URL variable
if($_GET['out']){
$out=$_GET['out'];
}

// redirect
header ("location: $out");
?>
mlseim is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 +1. The time now is 09:05 PM.


Advertisement
Log in to turn off these ads.