Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2008
    Posts
    697
    Thanks
    8
    Thanked 17 Times in 16 Posts

    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!

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,469
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    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");
    ?>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •