/    Sign up×
Community /Pin to ProfileBookmark

Automatic detection of first visitor to page

Hi,
I made a site with prize for a visitor who first clicks on one link. Now I must write the actuall page for that link. ? When user clicks on link it should open a page with form for sending some information(name, e-mail). When someone opens that page it should be disabled for others. But if first person leaves it without submiting required informations than it should be reenabled again. Is it possible to do it in PHP? I think that posting links is forbidden, so can’t write it here, but if someone didn’t understand me- the site is in my profile(FAQ). ?
Thanks!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@jacjil2Jun 10.2009 — If you only need to store one winning record. Something like
[code=php]
if(isset($_POST['name']) && isset($_POST['email']) && !file_exists("winner.txt")){
$record = "name=".$_POST['name']." email=".$_POST['email'];
put_file_contents("winner.txt", $record);
}[/code]


This may be grossly over-simple, but I'm not sure what you are running here.
Copy linkTweet thisAlerts:
@EldoradoauthorJun 10.2009 — Thank you! But I think this code shows page to everyone until someone fills the form? I would like to hide it after first visitor opens it. (To avoid congratulating to the wrong person. ? ) Maybe current time could be stored in a cookie and (if_cookie != that_time) show another page? If that person leaves the page than enable it again. ?
×

Success!

Help @Eldorado spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...