Hello Steemit Family , I will gonna show you one of my project , Its all about buying burger ,Im using a language PHP .
dbcon.php
index.php
admin.php
register.php
login.php
<?phprequire_once('dbcon.php');
if(isset($_POST['login']))
{
try
{
$uname=$_POST['uname'];
$psword=$_POST['pword'];
$login=$pdo->prepare ("select * from user where username=:user and password=:pword");
$login->bindvalue(':user',($uname));
$login->bindvalue(':pword',($psword));
$login->execute();
if($login->rowCount() >0)
{
$result=$login->fetchAll();
foreach($result as $row):
$_SESSION['isLogged']=true;
$_SESSION['utype']=$row['usertype'];
endforeach;
if($_SESSION['utype'] =="costumer")
{
echo ' <script language="javascript" type="text/javascript">
alert("Login Successfully");
window.location.href="costumer.php";
</script> ';
}
else
{
echo ' <script language="javascript" type="text/javascript">
alert("Login Successfully");
window.location.href="admin.php";
</script> ';
}
}
else
{
$_SESSION['isLogged']=false;
echo ' <script language="javascript" type="text/javascript">
alert("Invalid Username or Password");
window.location.href="index.php";
</script> ';
}
}
catch(PDOException $ex)
{
die('Data transfer Error '.$ex->getMessage());
}
}
?>
------->>>>>>Continuation----------->>>>>>>>
https://steemit.com/programming/@nathaliekeith/cont-php-projects
follow me @nathaliekeith