We help IT Professionals succeed at work.
Get Started

PHP Login (Security)

wantabe2 asked
Last Modified: 2012-05-11
I have a database I pull data from via a web browser. The database is a MySQL database. I just created a landing page I would like to enable users to enter a username & password before they can go any further. I have another table set up in my MySQL database with the following fields:


The UID is a unique auto incrementing ID. The permission field is either a 0 or a 1. A 0 is view only & a 1 is an administrator. My question is, how can I adit this code so a user can enter their uname & password & then click submit then they will be taken to index.html. If they don't have a uname, they won't be able to go past the landing_page.html. Thanks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<style type="text/css" media="screen">@import "./includes/layout.css"; </style>
<body style="background-image:url(FadedBG.png); background-repeat:no-repeat; background-attachment:fixed; background-position:center;">


<form method="post" action="" onSubmit="return checkme()">

<div id="Header"><center><b><i>Employment Tracking System</i></center> </b></div>


<td><b>User Name:</b> 
<input type="text" name="uname" size="30"  /><br />


<input type="text" name="password" size="32"  /><br />


<input type="submit" value="Submit" />


Open in new window

Watch Question
Most Valuable Expert 2011
Author of the Year 2014
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE