We help IT Professionals succeed at work.
Get Started

PHP Login (Security)

wantabe2
wantabe2 asked
on
329 Views
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:

uid
uname
password
permission

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"
        "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>ETS</title>
<style type="text/css" media="screen">@import "./includes/layout.css"; </style>
</head>
<body>
<body style="background-image:url(FadedBG.png); background-repeat:no-repeat; background-attachment:fixed; background-position:center;">

<?php
require('connection.php');
?>

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

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

<center><h1>ETS</i></h1></center>

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

<br>

<td><b>Password:</b> 
<input type="text" name="password" size="32"  /><br />
</td>

<br>

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

</body>
</html>

Open in new window

Comment
Watch Question
Most Valuable Expert 2011
Author of the Year 2014
Commented:
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