Avatar of wantabe2
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:

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

PHPHTMLHTTP Protocol

Avatar of undefined
Last Comment
Ray Paseur

8/22/2022 - Mon