Go4Expert

Go4Expert (http://www.go4expert.com/)
-   JavaScript and AJAX (http://www.go4expert.com/forums/javascript/)
-   -   Login and Database Script (http://www.go4expert.com/forums/login-database-script-t21696/)

carterlangley 7Apr2010 20:53

Login and Database Script
 
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!

ManzZup 7Aug2010 10:15

Re: Login and Database Script
 
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

johnny.dacu 12Aug2010 18:32

Re: Login and Database Script
 
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).


All times are GMT +5.5. The time now is 23:45.