PDA

View Full Version : php question


Relic
08-02-2002, 10:16 PM
Does anyone know of a php script which when used as an index.php will randomly load a different main page for visitors who re-visit. I know certain scripts have this built in, but does anyone know if something like this exists separetly?

Cyborg
08-03-2002, 12:13 AM
I can write you one if you want hit me on icq 19671897 or pm

AgentCash
08-03-2002, 12:23 AM
Be careful Cyborg... assisting a minor off of an adult board might land you in hot water.

wd-
08-03-2002, 12:24 AM
A minor?
Is relic underage?

AgentCash
08-03-2002, 12:27 AM
Underage, blackmailer, cheater, hacker, you name it.

http://bbs.adultwebmasterinfo.com/showthread.php?s=&threadid=1160&highlight=Relic+cheater

Mathew
08-03-2002, 12:29 AM
Originally posted by AgentCash
http://bbs.adultwebmasterinfo.com/showthread.php?s=&threadid=1160&highlight=Relic+cheater

06-18-2001 04:33 PM <- that's the date of this post, more than a year ago.. If he was 17 then, now he is 18 thus it's legal for him to do this business. However, I don't know, and anyway I can bet he won't tell that :D

skazzel
08-03-2002, 12:33 AM
Do you want to show one particular page on the first visit, and then random pages on subsequent visits, or random pages all the time? Should the script track the pages the visitor has seen and only show them the pages they haven't yet seen? If yes, then what should happen if the user has seen all available pages? The following script will show one page on the first visit (new.html), and one on each repeat visit (repeat.html).



<?php

if (isset($_COOKIE['repeat'])) {
$fp = fopen('repeat.html', 'r');
} else {
$fp = fopen('new.html', 'r');
setcookie('repeat', 'true');
}

fpassthru($fp);

?>

Relic
08-03-2002, 01:19 AM
Thanks man that will work great.
And agentcash, call me what ever you wish, but I am not the one attempting to instigate fights on a message board.

Relic
08-03-2002, 01:22 AM
hey skazzel, what would I have to change to cause that cookie being set to expire after an hour. Or, to make it so that after they have seen the repeat.html the cookie is erased,so that the next time the loop begins again. Thanks for your help btw.

skazzel
08-03-2002, 01:37 AM
Relic,

To make it erase the cookie when the repeat.html page is shown:


<?php

if (isset($_COOKIE['repeat'])) {
$fp = fopen('repeat.html', 'r');
setcookie('repeat', '');
} else {
$fp = fopen('new.html', 'r');
setcookie('repeat', 'true');
}

fpassthru($fp);

?>


This will delete the cookie so it will alternate between the two pages.

Relic
08-03-2002, 01:52 AM
Thanks a lot for the help dude.
Works perfectly.