Solved

AJAX or jQuery Login Field Validation Form / HTML - PHP

Posted on 2010-09-04
8
1,024 Views
Last Modified: 2012-06-22
Hello,

I'm running a family website which is coded purely in HTML. In some pages I used simple jQuery. I would like to put a simple AJAX or jQuery based login form to athenticate family members. The form will contains only Username and Password. I would like to verify the credentials on Server Side.

The website is running on CentOS 5.4 using cPanel. All s/w is up to date. This is a dedicated server. Any further solution or resources would be appreciated.

Thanks.
0
Comment
Question by:SrinathS
8 Comments
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 200 total points
Comment Utility
HTML by itself doesn't support 'authentication'.  It won't check every page to see if the user is logged in.  You can use '.htpassword' in Apache and that will require a login to the directory you put it in.  http://httpd.apache.org/docs/2.0/programs/htpasswd.html  Or you can convert your pages to PHP which is a server side language that can be used to control access along with other things.
0
 

Author Comment

by:SrinathS
Comment Utility
I would like to put login authentication files under login folder and will redirect the vistor to certain folder if he entered the login details correctly. Can I do that? Is there any such kind of simple login scripts available?

I don't need any database, I prefer to check pre-defined user credentials on server side. I'm okay to use php, because the validation/authentication is done on seperate folder on website.
0
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 200 total points
Comment Utility
There are many login scripts available.  You have to include the login check on every page that you want to protect.  If you don't then someone who finds out what the page address is can skip the login and just go directly to the page.
0
 
LVL 5

Assisted Solution

by:onemadeye
onemadeye earned 100 total points
Comment Utility
Hi,
check this out and see if you can integrate it with your site :

http://roshanbh.com.np/2008/04/ajax-login-validation-php-jquery.html
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 108

Accepted Solution

by:
Ray Paseur earned 200 total points
Comment Utility
The process for login validation is one part of the issue and the AJAX or jQuery wrapper is an entirely separate part of the issue.  I have an article here at EE that will help with the first part.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_2391-PHP-login-logout-and-easy-access-control.html?sfQueryTermInfo=1+30+login+logout

There is really no magic to using AJAX, but it is harder to debug code that is hidden behind the asynchronous calls.  Suggest you get the login validation part working first with regular HTTP calls, then modify the scripts to use AJAX (if you feel that really adds value).

Best, ~Ray
0
 

Author Comment

by:SrinathS
Comment Utility
Yes,

If I implement  login system, I need to update all the existing HTML pages to protect entire website. As per one of Expert's comment, protecting the folders using .htaccess file looks simple.

Is there any way to customize the .htaccess authentication? i.e., Instead of simple login pop-up box, can I customize it to appear as regular website login? I'm thinking to protect entire public_html folder using .htaccess or similar. So that only authenticated users can see the website.

Any further comments would be greatly appreciated. Thanks!
0
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 200 total points
Comment Utility
".htaccess authentication" is not put up by the HTML pages but by the server and the browser.  There is nothing to customize.
0
 

Author Closing Comment

by:SrinathS
Comment Utility
I've deicided to implement PHP login system. To do this, I converted all HTML files into PHP pages and currently studying some  basic PHP login systems.

Most probably I will hire a freelancer to do customized Ajax login validation system in PHP using jQuery.

Thanks.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now