1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Login and Database Script

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

  1. carterlangley

    carterlangley New Member

    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

    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

    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