...

View Full Version : [Q] create a “random webpage” but 1 link only 1 day



ref1
01-06-2012, 02:19 AM
I want to make a html file, or php file. suppose it's a html file when I open this html, it will redirect to random page, ex: this time it redirects to google, another time it redirects to facebook, and I found some script to to this, but they were not really good.

here is javascript code: http://javascriptsource.com/navigation/random-page.html and here is php code (I'm using this one, because it's easier, the list of website is in a .txt file) http://www.webmaster-a.com/php-go-to-a-random-page-or-advert.php

but what I want to do is: how to make it , 1 link only redirect 1 time in 24 hours (like unique visitor)

ex: my html file has 2 links:

google.com
facebook.com

the first time I open my html file, it redirects to google, and never redirect to google again in 24 hours. after 24 hours, it can redirect to google again. so the second time it must redirect to facebook.

like that. You can give me javascript, php code, or anything you want, but I want it must be like that. (like I'm trying to make unique visitor :D)

thank you

[if you're not sure what I mean, please let me know I will tell you more details]

mlseim
01-06-2012, 02:53 AM
Can you tell us what the purpose of this will be?
There might be a "best" way of doing it, but it would help if we knew why.

What do you define as a "unique visitor"?
By using cookies on a PC?
By some sort of IP address (which is not reliable)?
By a login of some kind?

Are the pages on your own site?
Are you just using Google and Facebook as an example?

.

ref1
01-06-2012, 04:07 AM
What do you define as a "unique visitor"?
By using cookies on a PC?
By some sort of IP address (which is not reliable)?
By a login of some kind?

that's the problem, but cookies should be better, right?
or can you just make it like: after open the html file, the page go to somewebsite1.com, and wait 30 seconds, refresh and go to somewebsite2.com, so open only 1 time, and we can have it go to many websites (like what I said I want 1 site only open 1 time / 24 hours)
then we don't need to use cookies, because it refreshes the webpage automatically and each time it refreshes , it go to another site


Are the pages on your own site?
Are you just using Google and Facebook as an example?
yeah I own the pages
what I need is your help, I need the code (it can be html, javascript, or whatever)
because I don't know programming, one good thing is I found it forum :o
Please help me


Can you tell us what the purpose of this will be?
There might be a "best" way of doing it, but it would help if we knew why.

I'm not sure will you guys get angry at me if I tell you? But let's be honest
I want to use this site for advertising: I have a website http://mysite.com (I didn't buy the domain because I still don't have the code I want, this domain is just an example) and I want to advertise on this site. So every time someone go to that domain. it will redirect to a random ad, I mean I don't want they go to that site and only see always 1 ad :D, I want they will see that ad again in next 24 hours (not like they just the ad 2 hours ago, and then see it again, bored , right?)

thank you and really need your help

[i'm trying to learn some english, so as you know, there are many grammar errors :o]

mlseim
01-06-2012, 01:25 PM
Now I'm having the problem understanding the "go to a site".

They will not be leaving your website, they are being shown a different page?
Or do they actually get redirected to someone else's website?

If you have the visitor leave your site, you've lost the visitor ... you can't redisplay another
page in 30 seconds.

And what are the ads? Are they just a URL, or are they a graphic thing?
Who puts the list of ads into your website ... a database of some kind?

If you're trying to do a thing where you get "add clicks" for randomly going to
different pages, or displaying different ads, you should know that Google adsense,
and all the others won't accept those. There are things in place to know where
clicks came from. That's why sweatshops in India hire hundreds of people to sit
and visit different websites, and click on things ... to make money.

ref1
01-07-2012, 10:34 PM
so no one is gonna help me?
but why you really need to know the purpose. i'm not gonna use it in a bad purpose, don't worry. i own an ptc site, when people click 1 ad, i want them to see random content, so i can advertise more than regular. i don't want to tell you i own a ptc site, but because you want to know, so it's fine.
can you help me?

mlseim
01-08-2012, 12:03 AM
Start with the database of ads ... do you have a place to store them?
Whether it's the URL, a graphic image, and information about the ad?

You need a database first ... like MySQL.

ref1
01-08-2012, 04:33 AM
no I don't need database
these ads are url, like facebook and google in example
and I am the owner of these ads (of course, because I want to advertise)
so I have a list of url, and a ptc site
when some one click an ad, instead of only 1 content can show, i can randomly show them many ad, like at the same time, the person named A view my ad A, and another person B view ad B, so that helps me in advertising

but is it possible to write a script like I want?

mlseim
01-08-2012, 05:33 PM
Quote: "so I have a list of url"

A list is a database. What is your list? Where is your list?
You need a PHP script to get the URL's from that list.

ref1
01-09-2012, 01:52 AM
Quote: "so I have a list of url"

A list is a database. What is your list? Where is your list?
You need a PHP script to get the URL's from that list.

i don't know PHP
can you help me?

mlseim
01-09-2012, 03:12 AM
Tell me about your list ....
Did you create it using Notepad? or what exactly is your list?
That's the most important part.

ref1
01-09-2012, 05:02 AM
Tell me about your list ....
Did you create it using Notepad? or what exactly is your list?
That's the most important part.

yeah! I used notepad !
it's a *.txt file, simple

this txt file contains links, 1 line = 1 link, easy to manage :D

mlseim
01-09-2012, 12:31 PM
I guess you start out like this ....

An example on how to at least display some random ads ...


<?php

// put all of the ads into an array
$ads=file("mytextfile.txt");

// randomize the array
shuffle($ads);

// now you have a random list of ads ...

// the first ad:
echo $ads[0];

// the 2nd ad:
echo $ads[1];

?>



Now, the cookie part (and the 24 hour thing). Are you going to use cookies for that?
Will it be "by computer"? That's all cookies can do.

If cookies are the way ... which is all you can really do, because you don't
have any user log-ins ... somehow, you'll have to know which ad to show for
a particular 24 period. That's the hard part of this.

Decisions need to be made about the ads that each user sees.
Let's say you have a random list for each user ... does it change every time they
click an ad, or does the one ad change every 24 hours? Does each user see their
own random list, or is the random list for all users?

How many ads will you have?

It's possible that what you're doing cannot be done ... I guess it depends on what you're doing.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum