Jump to content

Simple Javascript "show If" Help


slashjack

Recommended Posts

Javascript doesn't provide any security for that type of thing, is PHP an option? You can still use Javascript to send an ajax request to PHP to check the password and return the filename, but if you have things like the path to the file or the password checking in Javascript code then anyone can read that.

Link to comment
Share on other sites

You can use the window.prompt function to get the password. If the password is correct then you can use window.open to open the link to the document in a new window, or you can set window.location.href to redirect the current page to the document.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...