?
Solved

AJAX or jQuery Login Field Validation Form / HTML - PHP

Posted on 2010-09-04
8
Medium Priority
?
1,033 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 800 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 800 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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
LVL 5

Assisted Solution

by:onemadeye
onemadeye earned 400 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 111

Accepted Solution

by:
Ray Paseur earned 800 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 800 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

801 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