Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

AJAX or jQuery Login Field Validation Form / HTML - PHP

Posted on 2010-09-04
8
Medium Priority
?
1,036 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 84

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 84

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 84

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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…
Suggested Courses

636 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