Solved

AJAX or jQuery Login Field Validation Form / HTML - PHP

Posted on 2010-09-04
8
1,029 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 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 200 total points
ID: 33605632
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
ID: 33605666
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 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 200 total points
ID: 33605780
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 5

Assisted Solution

by:onemadeye
onemadeye earned 100 total points
ID: 33605887
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
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 200 total points
ID: 33606431
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
ID: 33607206
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 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 200 total points
ID: 33607303
".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
ID: 33617083
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

856 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