PHP ProjectssteemCreated with Sketch.

in programming •  7 years ago  (edited)

Hello Steemit Family , I will gonna show you one of my project , Its all about buying burger ,Im using a language PHP .

dbcon.php

dbcon.PNG

index.php

index.PNG

admin.php

admin1.PNG

admin2.PNG

admin3.PNG

admin4.PNG

admin5.PNG

admin6.PNG

register.php

register1.PNG

register2.PNG

register3.PNG

login.php

<?php

require_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

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!