Is this possible?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
username1234
Forum Newbie
Posts: 1
Joined: Fri Dec 02, 2011 8:05 pm

Is this possible?

Post by username1234 »

Hello.

Let me start with that I am not a php developer and I am not a programmer.

So this is what I want. I need a concept like bit.ly , but a bit different. I need my website to create URLs that redirect to multiple websites, lets call these URLs "Xlinks" . Let me give you an example.

Lets say I own 5 websites. I put them behind a Xlink and I post this Xlink here.
I get 100 clicks on the Xlink, but I don't want all 100 clicks to be delivered to just one website, I want my 5 websites to get 20 clicks each. So basically each time the Xlink is clicked, the user ends up on a different website.

Thanks in advance :)
:drunk:
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Is this possible?

Post by Celauran »

Sure, that's possible. Rather than mapping the shortened link to one URL, you map it to five. When the shortened URL is called, you grab one of the five at random and redirect.
User avatar
egg82
Forum Contributor
Posts: 156
Joined: Sat Oct 01, 2011 9:29 pm
Location: Colorado, USA

Re: Is this possible?

Post by egg82 »

another way would be to direct that link to a page that redirects to a random page. I like Celauran's idea better, though.
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: Is this possible?

Post by twinedev »

And even more, if you are wanting it to rotate per person, use a cookie to keep track for each separate visitor so instead of doing completely random, you are doing random of the ones they have not yet visited, (after all are hit, reset back to beginning)
Post Reply