Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.48 KB | None | 0 0
  1. <?php     //start php tag
  2.  
  3. //include connect.php page for database connection
  4.     include('config.php');
  5. //if submit is not blanked i.e. it is clicked.
  6. if (isset($_REQUEST['submit'])) //here give the name of your button on which you would like    //to perform action.
  7. {
  8. // here check the submitted text box for null value by giving there name.
  9.     if($_REQUEST['user_id']=="" || $_REQUEST['password']=="")
  10.     {
  11.     echo " Field must be filled";
  12.     }
  13.     else
  14.     {
  15.        $sql1= "select * from users where username= '".$_REQUEST['user_id']."' &&  password ='".$_REQUEST['password']."'";
  16.          $result=mysql_query($sql1)
  17.         or exit("Sql Error".mysql_error());
  18.         $num_rows=mysql_num_rows($result);
  19.        if($num_rows>0)
  20.        {
  21. //here you can redirect on your file which you want to show after login just change filename ,give it to your filename.
  22.            //header("location:filename.php");
  23.  //OR just simply print a message.
  24.          Echo "You have logged in successfully";    
  25.         }
  26.         else
  27.         {
  28.             echo "username or password incorrect";
  29.         }
  30.     }
  31. }    
  32. ?>
  33.     <html>
  34.     <head>
  35.      <title> GijoeTeam LoginPanel</title>
  36.      <link href="css/admincp.css" rel="stylesheet" type="text/css" media="screen">
  37.      <script src="js/jquery.js" type="text/javascript"></script>
  38.      <link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
  39.      <meta name="viewport" content="width=device-width, initial-scale=1.0">
  40.          
  41.             <style>
  42.                   .button {
  43.                 background-color: #4CAF50; /* Green */
  44.                 border: none;
  45.                 color: white;
  46.                 padding: 16px 32px;
  47.                 text-align: center;
  48.                 text-decoration: none;
  49.                 display: inline-block;
  50.                 font-size: 16px;
  51.                 margin: 4px 2px;
  52.                 -webkit-transition-duration: 0.4s; /* Safari */
  53.                 transition-duration: 0.4s;
  54.                 cursor: pointer;
  55.             }
  56.            
  57.             .button1 {
  58.                 background-color: white;
  59.                 color: black;
  60.                 border: 2px solid #4CAF50;
  61.             }
  62.            
  63.             .button1:hover {
  64.                 background-color: #4CAF50;
  65.                 color: white;
  66.             }
  67.            
  68.             .button2 {
  69.                 background-color: white;
  70.                 color: black;
  71.                 border: 2px solid #008CBA;
  72.             }
  73.            
  74.             .button2:hover {
  75.                 background-color: #008CBA;
  76.                 color: white;
  77.             }
  78.            
  79.             .button3 {
  80.                 background-color: white;
  81.                 color: black;
  82.                 border: 2px solid #f44336;
  83.             }
  84.            
  85.             .button3:hover {
  86.                 background-color: #f44336;
  87.                 color: white;
  88.             }
  89.            
  90.             .button4 {
  91.                 background-color: white;
  92.                 color: black;
  93.                 border: 2px solid #e7e7e7;
  94.             }
  95.            
  96.             .button4:hover {background-color: #e7e7e7;}
  97.            
  98.             .button5 {
  99.                 background-color: white;
  100.                 color: black;
  101.                 border: 2px solid #555555;
  102.             }
  103.            
  104.             .button5:hover {
  105.                 background-color: #555555;
  106.                 color: white;
  107.             }
  108.             </style>
  109.     </head>
  110.        
  111.        
  112.  
  113.        
  114.     <body class="w3-container">
  115.          
  116.          
  117.          
  118.         <header class="w3-container w3-teal">
  119.  
  120.         <h1>Gijoe LoginPanel</h1>
  121.         </header>
  122.            
  123.            <div id="loginp" class="cities">
  124.             <p>
  125.             <form action="login.php" method="post" enctype="multipart/form-data">
  126.            <input type="text" id="username" name="username" placeholder="Username">
  127.            <input type="password" id="password" name="password" placeholder="Password">
  128.             <button type="submit" class="button button2">Login</button>
  129.             </p>
  130.             </form>
  131.            
  132.  
  133.             </div>
  134.            
  135.          
  136.          
  137.     </body>
  138.     </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement