+ Reply to Thread
Results 1 to 8 of 8

Thread: Is Username Password script in JavaScript all right ??

  1. #1
    chiradeepg41 is offline x10Hosting Member chiradeepg41 is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    18

    Is Username Password script in JavaScript all right ??

    Sorry for disturbing...
    I made my site for my classmates. And to prevent unauthorized access i have added a javascript username password prompt system.
    My query is,
    Is the script allowable in x10 ???

    location:
    ape0913.x10.mx/download.htm

    Script
    ape0913.x10.mx/login.js

    Please Use:
    username - 1
    password - 1

    Thank you....
    hope for a quick reply!!

  2. #2
    gomarc's Avatar
    gomarc is offline x10 Elder gomarc is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    USA
    Posts
    511

    Re: Is Username Password script in JavaScript all right ??

    Hi chiradeepg41,

    I have no authority to speak for x10hosting, but I’m pretty sure that using a script like that will not bring you any problems with them. In fact there are many sites using some kind of username/password protection and this has never been an issue before.

    Regarding your goal "to prevent unauthorized access", don't expect much out of the proposed script. It's very easy to go around it and gain access to the usernames and passwords. If the user disables JavaScript in the browser, the protection is gone.

    By far a more secure option is to use a server side script to accomplish your goal. Have you looked into WordPress or any CMS?

  3. #3
    chiradeepg41 is offline x10Hosting Member chiradeepg41 is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    18

    Re: Is Username Password script in JavaScript all right ??

    Thank you gomarc..

    Well the security was more of a casualty than necessity!!
    People like us are not that much aware of bypassing such securities!
    Moreover even a simple HTML username password field which redirected to a non encrypted URL was not been able to bypassed...

    Thank you very much for your support....

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Is Username Password script in JavaScript all right ??

    Don't use JS for authorization. Even if someone doesn't understand JS, it's trivial to view the page source and find the username and password. You should use HTTP authentication, which can easily be set up using cPanel.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  5. #5
    chiradeepg41 is offline x10Hosting Member chiradeepg41 is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    18

    Re: Is Username Password script in JavaScript all right ??

    @misson .. thank you sir...
    but is it applicable to protect a single page ??
    if to protect a single page then what measure should i take ???

  6. #6
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Is Username Password script in JavaScript all right ??

    Yes, but you'll need to edit the authorization settings by hand. Enclose them in a Files section.

    Code:
    <Files foo.php>
        AuthType basic
        AuthUserFile "/path/to/your/htpasswds"
        AuthName "Foo"
        Require valid-user
    </Files>
    Alternatively, place the page in its own directory as an index file. That is, if the file is named "foo.php", make a folder named "foo" and move "foo.php" to "foo/index.php". You can then protect the directory "foo" using cPanel as normal.
    Last edited by misson; 03-21-2011 at 01:32 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  7. #7
    chiradeepg41 is offline x10Hosting Member chiradeepg41 is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    18

    Re: Is Username Password script in JavaScript all right ??

    thanx mission..
    i opted for the second option..
    It was just the thing I wanted to incorporate!!

    Thank you again!
    x10 is amazing !!

  8. #8
    roby718 is offline x10Hosting Member roby718 is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    53

    Re: Is Username Password script in JavaScript all right ??

    If you desperate want to use JS to do logins, write an ajax script that validates credentials using a php counterpart, because php source can't be downloaded (in some circumstances it can: server error).

+ Reply to Thread

Similar Threads

  1. password and username
    By omran jamal in forum Free Hosting
    Replies: 1
    Last Post: 08-10-2010, 01:37 PM
  2. Javascript : Small Script...Big Headache
    By PharaohInc in forum Programming Help
    Replies: 3
    Last Post: 03-30-2010, 12:18 PM
  3. Replies: 2
    Last Post: 03-12-2010, 03:23 PM
  4. Finding a Javascript News Bar script
    By rufussweetwater in forum Scripts & 3rd Party Apps
    Replies: 1
    Last Post: 06-22-2009, 12:19 PM
  5. basic password check - quick help!! - javascript
    By goldy300 in forum Programming Help
    Replies: 10
    Last Post: 11-21-2008, 09:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers