Forum Moderators: phranque

Message Too Old, No Replies

How to prevent direct URL typing and access

How to prevent bypassing a Form

         

tonynoriega

4:35 pm on Oct 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a form on my site that a user must fill out to view some of our product videos.

After completing the form, it redirects to the "thanks.asp" page with the videos.

How can i prevent a user from directly typing in the "thanks.asp" page to bypass the form?

thanks everyone.

Romeo

5:16 pm on Oct 4, 2006 (gmt 0)

10+ Year Member



You can prevent that by simply not having that additional "thanks.asp" page.

Include the logic of the "thanks.asp" into the "forms.asp" and let the forms page doing both:
If called out of the blue:
- show the empty form and let it submit to itself (method="post" action="forms.asp").
If called with form data:
- check the validity of the data and do the things you would have done in your thanks.asp.

Kind regards,
R.

LifeinAsia

5:21 pm on Oct 4, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Alternatively, if no form data is passed to thanks.asp, redirect the user to the page to fill out the form.

physics

6:06 pm on Oct 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It depends on what you're doing with the form but one way would be:

- User submits their email address and all other info in form.
- User is sent to a page saying their information has been entered, click this button to see thanks.asp (user's email is sent to thanks.asp from a hidden input on this page).
- When user gets to thanks.asp look up in the db if a user with the email address specified exists in the db. If it does, then show the videos.

As mentioned before this can all be done on the same .asp page if you want.

Quadrille

6:11 pm on Oct 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'll need to come up with a good story as to why you need an email address before showing a sales pitch - or people are quite likely to look elsewhere. And spend elsewhere. I certainly would.

None of my business, I know, but why on Earth would you want to make it hard for people to see sales videos? It's a whole new marketing approach to me!