SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I have a web page that only a handfull of users are allowed to view. I would like to password protect it so that only those certain users can login, and view that form. Is javascript the best way to do this? If so how would I go about doing this, thank you...

  2. #2
    SitePoint Addict
    Join Date
    Oct 2000
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    JavaScript is really a *very* insecure method of password protection.

    No matter how you slice it, you can't genuinely hide the page code.

    That being the case, anyone who knows JavaScript reasonably well can read the script and walk right through your password protection.

    If security is really important, here, this should be done server-side in Perl or PHP.

  3. #3
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Well I havent really gotten to deep into Perl or PHP, but I have heard good things about them. DO you have any really good Perl, or PHP sites you could recommend I look at for examples?

  4. #4
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Well I havent really gotten to deep into Perl or PHP, but I have heard good things about them. DO you have any really good Perl, or PHP sites you could recommend I look at for examples?

  5. #5
    SitePoint Addict
    Join Date
    Oct 2000
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Williamsba, go prowling sites like http://www.hotscripts.com and maybe get a look at some scripts; read through them a bit. There are quite a few around for password protection, both Perl and PHP.

    My personal preference is usually Perl; but mostly because I'm slightly more fluent in it than in PHP and, at least for now, there tend to be more scripts available for Perl. PHP is just as good for this, of course!



  6. #6
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Brad,

    You might also want check out http://www.cgi-resources.com or search through yahoo, etc for 'cgi scripts'.

    I'm presuming you have access to the cgi bin on your server?

    If not, and you are stuck with javascript, you will have to write cookies to identify your users. The cookie can contain the url for the page they should be redirected to. And once you extract that value, you can redirect them with a simple window.location = cookieURLValue statement.

    If you need a tutorial on cookies, see the one at: http://htmlgoodies.earthweb.com It is geared for newbies.

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •