/    Sign up×
Community /Pin to ProfileBookmark

Restricting access to a webpage without agreeing to a consent form

Hi Guys. I have a basic javascript form set up where the visitor agrees to terms and conditions before proceeding to the next page which is named testing.htm. All good there. The problem is that I don’t want visitors going directly to the testing.htm page without first accepting the T&C. I am a very basic coder and am better at the deign side of thing so any help greatly appreciated.

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@ray326Apr 16.2008 — You've got more problems than that if they have no or disabled Javascript. Do it with a cookie and enforce it on the server side rather than in the browser.
Copy linkTweet thisAlerts:
@LanceauthorApr 16.2008 — Thanks Ray. Are there any tutorials you know of that might be able to step me through it?
Copy linkTweet thisAlerts:
@ray326Apr 16.2008 — Search for "cookie" in combination with whatever server side language(s) you're using.

Actually another way to do it would be to use a form action on the first page to get to the second via a post. On the second page you'd check for some field passed in by the form. Again, the mechanisms are based on the coding language. I can do it with Java/JSP quite easily. Perl/CGI would be pretty simple, too. Of course these are all fairly simplistic and a determined visitor will be able to work around them if he really wants to. The vast majority won't.
×

Success!

Help @Lance 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 4.29,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

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