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

Login and Database Script

Discussion in 'JavaScript and AJAX' started by carterlangley, Apr 7, 2010.

  1. carterlangley

    carterlangley New Member

    Joined:
    Apr 7, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Ellon, Scotland
    Home Page:
    Hi guys,

    I hope somebody can help me here. I need a java script that will log a user into a membership only part of a website. Multiple members. I have no knowledge of programming or scripting nor of databases. I know that the company hosting the website offers mysql, so presumably I can use that as my database? But how to connect to it and then verify that the users are entering the correct username and password? If somebody could please help me out here, I would be very greatfull!
     
  2. ManzZup

    ManzZup New Member

    Joined:
    May 9, 2009
    Messages:
    278
    Likes Received:
    43
    Trophy Points:
    0
    Occupation:
    Production Manager:Software @ ZONTEK
    Location:
    Sri Lanka
    Home Page:
    the language you need is not jscript its php
    jscript is client side and not the type for connecting to a database
    use php and for members section you need to add the session code on top of each webpage that need authenciation

    it simple :D
    try googleing and you don't find it post here, i'll try to post an example
     
    shabbir likes this.
  3. johnny.dacu

    johnny.dacu New Member

    Joined:
    Jul 6, 2010
    Messages:
    88
    Likes Received:
    4
    Trophy Points:
    0
    The mechanism is like this: As ManzZup said php to perform login/register tasks. When you create a form (login or register, but i'll talk only about login), you have an attribute for form tag called "action" where you put the url for the page where data is submited. Most often page is on the same location. Lets say "perform_login.php".
    When you hit submit, data from your form inputs is sent and available on that page (script). Then you perform a select on db with that values (username and password). If you have a row result then the user/pass combination is good. User is valid. Save this result in a session (with is a reference to client browser).
     
    shabbir likes this.

Share This Page