Jump to content

How to restrict access to html pages?


UrbanDweller

Recommended Posts

Hey,

 

What i mean by this is if i have a form that needs information before form pages is requested i dont want people to be able to access form by directly accessing page from its url.

If after form is sent that a error will pop up if user clicks back in browser etc?

 

I just want form page to be accessed only by page1. do i need to create a annon id for each user? or just a function that checks previous page url somehow?

 

"page1->Form>page3"

 

Thanks

 

 

Link to comment
Share on other sites

You could just keep a small stack of the pages last viewed by the user in their PHP session. If they didn't come from 'page1 > form page', then just redirect them to page1 or display an error.

 

Why dont they build javascript into browsers cause i keep thinking about disabling javascript while using a form could disrupt js validation.

 

Even if it was impossible to disable JS in the browser settings, it's still code ran on the client's machine and is therefore not trustworthy. Anything from the client can be manipulated.

Link to comment
Share on other sites

Yeah thats just what i was thinking of doing too.

 

Even if it was impossible to disable JS in the browser settings, it's still code ran on the client's machine and is therefore not trustworthy. Anything from the client can be manipulated.

 

I know that its more for functionality, as so many web developers are using js in there sites these day for forms etc you would hope for the users sake that they had it automaticlly when browsing as to not inhibit their browsing experience

Link to comment
Share on other sites

you would hope for the users sake that they had it automaticlly when browsing as to not inhibit their browsing

 

JavaScript can also inhibit the browsing experience though, which is why there's the option to turn it off. That said, JS should only enrich the the user's experience; if it's disabled the site should still be usable. Of course 9/10 that's probably not the case.

 

HTML5 is actually introducing built-in browser validation, to try and tackle the problem:

 

http://blog.mozilla.com/webdev/2011/03/14/html5-form-validation-on-sumo/

 

Given that IE9 and Safari don't support it at all yet though, JS solutions are going to be around for a while -- especially considering IE6 is still a major headache for those of us unlucky enough to have to support it still.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.