Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I redirect based on visitor count?

Status
Not open for further replies.

keen01

MIS
Nov 16, 2004
73
0
0
US
I want the first person to visit a page to be redirected to a "Winner, You are the first to view this page" and everyone after that just gets the normal page. There's got to be a way in PHP to combine a counter and page redirect. Got any ideas or solutions?
 
Well it is not in rigth section then this question should go either to PHP or ASP. it demands some back-end programming().
1-)Lets say you want the visitors first visit wnat to show as winner. then you need IP address and a data to keep record. To keep data files and MySQL comes handy.
2-)if you want any first winner then volla. you just make sure that the ip address is not yours and it is the first visitor. Again you will need to work with data.
 
i think php and mysql would make this simple.

make a table with only one cell and set it to zero.

create a php if function.

if 0 then set cell to 1 and go to winner page.

elseif 1 go to regular page.

Darryn Cooke
| Marketing and Creative Services
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top