Avatar of wantabe2
Flag for United States of America

asked on 

PHP Login (Security)

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


Avatar of undefined
Last Comment
Ray Paseur

8/22/2022 - Mon