A basic login system typically contains 3 components which can be created using PHP and MySQL :
Component 1: Allows registration of preferred login Id and password.
This is created in simple HTML form that contains 3 fields and 2 buttons:
1. A preferred login id field
2. A preferred password field
3. A valid email address field
4. A Submit button
5. A Reset button
Lets say the form is coded into a file named register.html. The following HTML code extract is a typical example. When the user has filled in all the fields and clicks on the submit button, the register.php page is called for.
The following code extract can also be used as part of register.php to process the registration. The code connects to the MySQL database and inserts a line of data into the table used to store the registration information.
@mysql_connect("localhost", "mysql_login", "mysql_pwd") or die("Cannot connect to DB!");
@mysql_select_db("tbl_login") or die("Cannot select DB!");
$sql="INSERT INTO login_tbl (loginid, password and email) VALUES (".$loginid.",".$password.",".$email.")";
$r = mysql_query($sql);
if(!$r) {
$err=mysql_error();
print $err;
exit();
}
The code extract assumes that the MySQL table that is used to store the registration data is named tbl_login and contains 3 fields - the loginid, password and email fields. The values of the $loginid, $password and $email variables are passed in from the form in register.html using the post method.
Component 2: Verification and authentication of the user.
In this the HTML form typically contains 2 fields and 2 buttons:
1. A login id field
2. A password field
3. A Submit button
4. A Reset button
Assume that such a form is coded into a file named authenticate.html. The following HTML code extract is a typical example. When the user has filled in all the fields, the authenticate.php page is called when the user clicks on the Submit button.
The following code extract can be used as part of authenticate.php to process the login request. It connects to the MySQL database and queries the table used to store the registration information.
@mysql_connect("localhost", "mysql_login", "mysql_pwd") or die("Cannot connect to DB!");
@mysql_select_db("tbl_login") or die("Cannot select DB!");
$sql="SELECT loginid FROM login_tbl WHERE loginid='".$loginid."' and password='".$password."'";
$r = mysql_query($sql);
if(!$r) {
$err=mysql_error();
print $err;
exit();
}
if(mysql_affected_rows()==0){
print "no such login in the system. please try again.";
exit();
}
else{
print "successfully logged into system.";
//proceed to perform website's functionality - e.g. present information to the user
}
As in component 1, the code excerpt assumes that the MySQL table that is used to store the registration data is named tbl_login and contains 3 fields - the loginid, password and email fields. The values of the $loginid and $password variables are passed in from the form in authenticate.html using the post method.
Component 3: When the user forgets his logion password this 3rd component sends his password to the users registered email address.
The HTML form typically contains 1 field and 2 buttons:
• A login id field
• A Submit button
• A Reset button
Assume that such a form is coded into a file named forgot.html. The following HTML code excerpt is a typical example. When the user has filled in all the fields, the forgot.php page is called when the user clicks on the Submit button.
The following code excerpt can be used as part of forgot.php to process the login request. It connects to the MySQL database and queries the table used to store the registration information.
@mysql_connect("localhost", "mysql_login", "mysql_pwd") or die("Cannot connect to DB!");
@mysql_select_db("tbl_login") or die("Cannot select DB!");
$sql="SELECT password, email FROM login_tbl WHERE loginid='".$loginid."'";
$r = mysql_query($sql);
if(!$r) {
$err=mysql_error();
print $err;
exit();
}
if(mysql_affected_rows()==0){
print "no such login in the system. please try again.";
exit();
}
else {
$row=mysql_fetch_array($r);
$password=$row["password"];
$email=$row["email"];
$subject="your password";
$header="from:you@yourdomain.com";
$content="your password is ".$password;
mail($email, $subject, $row, $header);
print "An email containing the password has been sent to you";
}
As in component 1, the code excerpt assumes that the MySQL table that is used to store the registration data is named tbl_login and contains 3 fields - the loginid, password and email fields. The value of the $loginid variable is passed from the form in forgot.html using the post method.
This is how a basic login system can be created. The software developer can include additional tools like password encryption, access to the user profile in case they wish to edit their profile etc.
This article has been compiled by the content development team at Pegasus InfoCorp which pulls subject matter specialists from different work domains. They can be contacted through the Pegasus InfoCorp website at info@pegasusinfocorp.com. Pegasus InfoCorp is an India based web design, web development and online/offline software development company. Please visit http://www.pegasusinfocorp.com to read more articles and know more about us!
Other companies and organizations are welcome to reprint this article on their websites provided the following conditions are met.
?The article is not changed in any manner
?The article is copied as is in its entirety (including back links to the Pegasus InfoCorp website).
?The company/ organization reprinting the article agrees to defend, indemnify and hold harmless Pegasus InfoCorp, its employees, directors, officers, agents, partners and their successors and assigns from and against any and all liabilities, damages, losses, costs and expenses, including attorney's fees, caused by or arising out of claims based upon the use of the article, including any claim of libel, defamation, violation of rights of privacy or publicity, loss of service by subscribers and infringement of intellectual property or other rights
Make A Login System
Evidently, not all recruitment scripts are the same and depending on your experience with searching for the right one, you might have run into some real ding-dongs out there. Ranging from costing nothing at all to costing hundreds of dollars or more, recruitment scripts significantly vary in both quality and function. This article will describe one very important feature that every recruitment script should provide regardless of price.
To protect the people that use the recruitment script, including the administrator (you), job seekers, and employers, the script should ensure each individual that all member records are kept private. This includes the names, addresses, phone numbers, social security numbers (for tax reasons) and financial information (credit card numbers, bank accounts, etc.) of those who will perform transactions on the site.
The recruitment script should allow each person to create a unique username and password that will be used to create and access an account that stores this kind of personal information. None of this information should be accessible by anyone other than the its original account owner.
In addition to storing personal information, the same login section should allow each member to describe his or her skill set. Freelancers should be able to post a resume and clients should be able to post a description of their businesses. Although most of the information contained in the login section should be private, resumes and business descriptions should be accessible by all members that access the recruitment script. Global access to these descriptions is vital to the success of the job board since freelancers and clients will want to learn about each other.
Another reason why every recruitment script needs a login system is to prevent spam. Since each recruitment script is accessible and viewable from the web, spammers will take advantage of a system that doesn't verify who has and who hasn't permission to use it. Spammers will always post inappropriate ads and with today's technology, they can fill a job board with nonsense advertisements overnight and essentially make the board unusable before the next morning.
To make your recruitment script more personal and interactive, you can set it up so that only specific services are available to those who log in. For example, you may not want to show the entire list of available jobs to just any person who stumbles across your recruitment script. Or you may not want just any stranger reading freelancer's replies to client requests. By requiring members to log in first, your recruitment script can display its whole list of available jobs and freelancer replies (and more) only after visitors enter the site with a personal username and password.
One of the key ideas behind a recruitment script is automation and through automation, you can take advantage of such processes via logging. Any recruitment script worth its weight will automatically record all member activities (signing in, posting jobs, responding to jobs, etc.). These records can be handy should a client or freelancer need to track the jobs that they've received, assigned, completed, or paid for. But since this information is private, access via lock and key (username and password) is an absolute requirement.
Of course nothing in a member's account should be non-editable. Over time, people move and change addresses, they get married (or get divorced) and change names, they switch banks, they get new credit card numbers, and so on and so forth. Therefore the information created as a member should be editable and should be quickly accessed by other critical parts of the recruitment script to accurately send out checks in a timely manner, for example. There's probably nothing more haphazard and disorganized than an online business that doesn't update edited records or work with new information as soon as it's made available.
As you can see, a recruitment script's login system is a vital part of keeping a job board not only safe and secure for everyone to use, it's also responsible for building a working environment that's accurate, responsible, timely, and trustworthy. In every aspect, an online recruitment script should duplicate the professional practices exemplified in a temporary employment office or other similar work environment. After all, in our new Internet-based society, the security and protection of private information could never be more important with detrimental cases of identity theft increasing everyday,
So when looking over your options, be sure to select a recruitment script that offers a login system with the features described above.
Both Pegasusinfocorp Pvt Ltd. & Ron Mcneil are contributors for EditorialToday. The above articles have been edited for relevancy and timeliness. All write-ups, reviews, tips and guides published by EditorialToday.com and its partners or affiliates are for informational purposes only. They should not be used for any legal or any other type of advice. We do not endorse any author, contributor, writer or article posted by our team.
Ron Mcneil has sinced written about articles on various topics from Legal Matters, Flirting Tips and Dental Practice. Ron McNeil promotes that allows you to run your own. Ron Mcneil's top article generates over 22200 views. to your Favourites.
At Home Wedding Ideas You should not also try too hard to please the guests. Your family and friends are there to rejoice this wonderful event with you and not to criticize your wedding