Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

 

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help.

 
Thread Tools
Old 07-02-2013, 08:24 AM   #1
lbazso
Confirmed User
 
lbazso's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: Europe
Posts: 470
Script/Code/HTML for redirecting

Hey Guys,

I am redirecting traffic to an url and from there I would like to create/copy a code/script/html (whatever works) so when the traffic comes in, it could not just redirect to 1 url but to randomly use one from a list of url's each time or every 5th time for example.

I hope I wrote it clearly. I am trying to explain it the best I can!

I would really appreciate some help or advise!

Thanks so much!

Laszlo
lbazso is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-02-2013, 08:32 AM   #2
Best-In-BC
Confirmed User
 
Best-In-BC's Avatar
 
Join Date: Jun 2002
Posts: 9,506
I use to have a php script that just picked a random url out of a text file to go to. Is this what your talking about ?
__________________
Vacares - Web Hosting, Domains, O365, Security & More
Unparked domains burning a hole in your pocket? 5 Simple Ways to Make Easy $$$ from Unused Domains
Best-In-BC is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-02-2013, 09:13 AM   #3
lbazso
Confirmed User
 
lbazso's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: Europe
Posts: 470
Quote:
Originally Posted by Best-In-BC View Post
I use to have a php script that just picked a random url out of a text file to go to. Is this what your talking about ?
That sounds about right!

Does it redirect too?

Thanks in advance!
lbazso is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-06-2013, 05:42 AM   #4
lbazso
Confirmed User
 
lbazso's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: Europe
Posts: 470
I am still looking for a script. If anyone can help, it would be greatly appreciated. Thanks!
lbazso is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-06-2013, 07:19 AM   #5
lbazso
Confirmed User
 
lbazso's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: Europe
Posts: 470
Quote:
Originally Posted by lbazso View Post
I am still looking for a script. If anyone can help, it would be greatly appreciated. Thanks!
Never mind. I have found one and it works:

Code:
<script type="text/javascript">

var urls = new Array("http://www.url1.com/", "http://www.url2.com/");

function redirect()
{
window.location = urls[Math.floor(urls.length*Math.random())];
}

var temp = setInterval("redirect()", 1000);

</script>
lbazso is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-06-2013, 07:29 AM   #6
Nevet
Registered User
 
Industry Role:
Join Date: Dec 2011
Posts: 10
That won't work for users without Javascript, of course.
Nevet is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-06-2013, 07:30 AM   #7
lbazso
Confirmed User
 
lbazso's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: Europe
Posts: 470
Quote:
Originally Posted by Nevet View Post
That won't work for users without Javascript, of course.
Thanks!
lbazso is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-06-2013, 11:52 AM   #8
alcstrategy
Confirmed User
 
Industry Role:
Join Date: May 2012
Posts: 124
here is a very simple example in php

<?php
$urls = file('urls.txt');
$rand = array_rand($urls);
header("Location: {$urls[$rand]}");
?>

in urls.txt make each line a url

this is just a simple example and should be put before output otherwise you technically could put ob_start() at the beginning and supress output
alcstrategy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-06-2013, 12:28 PM   #9
Zeiss
Confirmed User
 
Industry Role:
Join Date: May 2012
Location: With your mom
Posts: 5,189
Better go the php way as above.
__________________


Adult Webmasters Guides
Zeiss is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-07-2013, 12:15 AM   #10
RaunchyRepublic
Registered User
 
RaunchyRepublic's Avatar
 
Industry Role:
Join Date: Jan 2011
Location: Sydney
Posts: 41
This is SEO suicide too, you know that right?
__________________
Raunchy Republic Sex Shop
Australia's Favourite Online Adult Store
Visit our Sex Blog
RaunchyRepublic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-07-2013, 01:50 AM   #11
lbazso
Confirmed User
 
lbazso's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: Europe
Posts: 470
Quote:
Originally Posted by RaunchyRepublic View Post
This is SEO suicide too, you know that right?
Yeah, I am aware of that. It has a different purpose.
lbazso is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-07-2013, 01:51 AM   #12
lbazso
Confirmed User
 
lbazso's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: Europe
Posts: 470
Quote:
Originally Posted by Zealotry View Post
Better go the php way as above.
Thanks for your input!
lbazso is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-07-2013, 01:52 AM   #13
lbazso
Confirmed User
 
lbazso's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: Europe
Posts: 470
Quote:
Originally Posted by alcstrategy View Post
here is a very simple example in php

<?php
$urls = file('urls.txt');
$rand = array_rand($urls);
header("Location: {$urls[$rand]}");
?>

in urls.txt make each line a url

this is just a simple example and should be put before output otherwise you technically could put ob_start() at the beginning and supress output
Thanks so much! Appreciate it!
lbazso is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-07-2013, 11:50 AM   #14
alcstrategy
Confirmed User
 
Industry Role:
Join Date: May 2012
Posts: 124
no problem. It's very simple but if you need any more help with it just let me know
alcstrategy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-08-2013, 07:25 AM   #15
lbazso
Confirmed User
 
lbazso's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: Europe
Posts: 470
Quote:
Originally Posted by alcstrategy View Post
no problem. It's very simple but if you need any more help with it just let me know
Thanks again and I will contact you!
lbazso is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-10-2013, 11:52 AM   #16
lbazso
Confirmed User
 
lbazso's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: Europe
Posts: 470
Quote:
Originally Posted by alcstrategy View Post
no problem. It's very simple but if you need any more help with it just let me know
Hi again,

I just would like to let you know that I have made my first sale since I have started using your php code! Thank you so much!!!!

Laszlo
lbazso is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-10-2013, 11:58 AM   #17
alcstrategy
Confirmed User
 
Industry Role:
Join Date: May 2012
Posts: 124
ha no problem glad I could help
alcstrategy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 07-10-2013, 12:06 PM   #18
lbazso
Confirmed User
 
lbazso's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: Europe
Posts: 470
Quote:
Originally Posted by alcstrategy View Post
ha no problem glad I could help
It's fantastic!!!! :D
lbazso is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
 
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.