Dynamic website content question

JoseArmando

work = life
Jul 24, 2008
2,456
65
0
So I'm wondering if this is possible.. probably should be done in php?

I need code that shows X.htm content to certain user (should probably place a cookie to track that user?) for 10 days, after that starts showing Y.htm content and after another 10 days shows Z.htm content.

Basically every new user that would come to that website would be guided through X, Y and Z through 20 days.

Is this possible?
 


Do you they goto A.htm and it redirects them to X.htm, Y.htm and Z.htm depending on the conditions above, so they are actually different physical pages, or they are all actually actually A.html which just changes depending on the conditions above.
 
Should be very easy to do actually.

You can take the users IP, put it into the db along with the time of first visit.

Then on each subsequent visit you query the db to see what you need to load, eg.

7days since 1st visit -> load x.html
14 days since 1st visit -> load y.html

To make this stuff even easier you can use a simple framework such as codeigniter (php), which provides easy functions for cookies/sessiondata etc.
 
Do you they goto A.htm and it redirects them to X.htm, Y.htm and Z.htm depending on the conditions above, so they are actually different physical pages, or they are all actually actually A.html which just changes depending on the conditions above.

Code should be in one file and redirect to other files.

Should be very easy to do actually.

You can take the users IP, put it into the db along with the time of first visit.

Then on each subsequent visit you query the db to see what you need to load, eg.

7days since 1st visit -> load x.html
14 days since 1st visit -> load y.html

To make this stuff even easier you can use a simple framework such as codeigniter (php), which provides easy functions for cookies/sessiondata etc.

Okay that sounds reasonable but I don't think it'd be very accurate since most users change IPs daily. How much do you think getting this coded would cost? Shouldn't be more than $30 right?
 
Code should be in one file and redirect to other files.



Okay that sounds reasonable but I don't think it'd be very accurate since most users change IPs daily. How much do you think getting this coded would cost? Shouldn't be more than $30 right?

Yeah, shouldn't cost too much to have this coded.

As mentioned above, adding cookie data (as well as whole system/browser profile possibly) would indeed improve accuracy.
 
Guys are on the right track. My PHP is a bit rusty, but maybe something like this:

if (!isset($_COOKIE['FirstVisit'])) {
setcookie("FirstVisit", time(), time()+5778463); //expires in 6 months
}

first _date= strtotime($_COOKIE['FirstVisit'][1])

//redirect based on difference between time() - first_date





-M