Jump to content

[SOLVED] Is this technical possible?


willdk

Recommended Posts

I see no reason why it wouldn't be possible.

I'm very curious HOW you make something like this, how do you START. I have searched for existing scripts, but there aren't.

 

If someone visits a redirect, his visit get lost. So you can't count this.

And if you CAN count this, how do you tell the script to stop redirect the visitors to page B.

 

I need a plan, because I have no idea.  :confused:

 

You could store the number of users redirected in a flat-file.

 

$num = file_get_contents('counter.txt');
file_put_contents('counter.txt', $num + 1);
if($num <= 50)
     header('Location: a.html');
else
     header('Location: b.html');

One of the ways would be to store the number of visits into a file.

Script would work like this (psudocode)

 


read number of visits from file
(if > 50) {
redirect to B 
}else {
increase number of visits by 1 and save to file
redirect to A
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.