1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Javascript Login/Password+cookie + registration form?

Discussion in 'Other Languages' started by h1tman, Mar 21, 2010.

  1. h1tman

    h1tman Junior Member

    Joined:
    Oct 2, 2009
    Messages:
    148
    Likes Received:
    16
    Hello guys I am new to the forum however I have a problem.

    I am trying to find a Javascript which will make a registration form enter username + password + date of birth and this can be wrote into a cookie and then the user can access the other parts of the website.

    I know its better to use something like php & mysql for this however I need to do this in Javascript and I seem to find it very difficult to even find something similar to this on the internet.

    Can anyone help me?
     
  2. voyevoda

    voyevoda Regular Member Premium Member

    Joined:
    Mar 21, 2010
    Messages:
    217
    Likes Received:
    97
    Location:
    Eastern Front
    Javascript can set cookies very easily. The problem part of your desired solution is that Javascript only runs in the user's browser.

    Since you can't determine on the server side whether or not a user can see some content or links, you will need to always send all the content to the user and use Javascript to make it visible if they're "logged in".

    Why do you need to do this in javascript? :confused:
     
  3. SEO20

    SEO20 Elite Member

    Joined:
    Mar 25, 2009
    Messages:
    2,017
    Likes Received:
    2,259
    Can you code a bit or are you looking for totally copy/paste?
     
  4. h1tman

    h1tman Junior Member

    Joined:
    Oct 2, 2009
    Messages:
    148
    Likes Received:
    16
    its an assignment.. but i think its stupid that we have to use Javascript and no php involved :(
     
  5. h1tman

    h1tman Junior Member

    Joined:
    Oct 2, 2009
    Messages:
    148
    Likes Received:
    16
    I know a little pascal object pascal/delphi but not javascript, and i find it quite difficult to understand even though its a scripting language compared to pascal/delphi which I find easier.
     
  6. h1tman

    h1tman Junior Member

    Joined:
    Oct 2, 2009
    Messages:
    148
    Likes Received:
    16
    so if i wanted to make a new user and existing user link and when they sign in and then gets redirected to a page. How can this be achieved?
    I know Javascript is used for generally form validation however this is what is driving me crazy I cannot see to find any information on this. Just pages explaining to enter a username and password on the fixed html page, which is stupid. I know in php/mysql it would connect to a database and etc but this is javascript...