PHP Redirect Help

by 6 replies
7
Anyone have a php redirect script for multiple URLs, that doesn't select the URL randomly?

thanks
#programming #php #redirect
  • Hi Ryan

    Perhaps it's because I've been at it all day and I'm tired, but I don't quite understand what you are asking for. Could you clarify it for an old guy like me? I might be able to assist you.



    Bill
  • Do you mean something like this?



    This was quickly thrown together - you might want to add extra error checking in there and such.

    Bascially, add your URLs and then to redirect just call it as;

    http://www.yoursite.com/?=

    Where;
    = the filename of the script
    = the value you enter in $exitvar
    = the number of the affiliate link.

    You might want to actually use an associative array so you can refernce it as ?ex=affiliatesite but you will have to change the code slightly to work it in.
  • You can easily use something like this:
    PHP Switch Statement
    PHP: switch - Manual

    I have it then redirecting links from my ebooks.
  • While I realize this is an older post, I'm surprised it hasn't been more active.

    When you get right down to it, I was having the same issues finding a script that did what I wanted it to do. So I wrote one! A nice and simple little script that will do a simple redirect WHERE you want it to go, or a random redirect depending on the traffic you are sending through it.

    If this sounds like something you may be interested please feel free to PM me.
    Later!
  • <?php
    header( 'Location: http://YOUR AFFILIATE ID/?' ) ;?>

    This is a standard php redirect without tracking code. - not really sure what you want. I do every link separately. It sounds like you bought a crappy randomizer - why I do not know. Loseweight-keepfit.com
  • You can do something very simple like so:

    USE:So you can register as many redirects as you like and then use the redirect by simply using that:..of course, you can just use:

    ..but the above allows you to manage your redirects better. You could then randomize, affix other parameters (random if you like), store and retrieve in database etc. etc.

    Hope that helps.

Next Topics on Trending Feed