Advertisement
Guest User

TinyBits IT Clib

a guest
Jul 13th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.26 KB | None | 0 0
  1. <?php if(isset($_COOKIE['id'])){
  2.     $COOKIE['id']= $userid;
  3.     header('Location:dashboard.php');
  4. } ?>
  5. <html>
  6. <head><marquee><title>TinyBits || Welcome To TinyBits</title></marquee>
  7. <link rel="stylesheet" href="scripts/css/index_css.css">
  8. <script src="scripts/js/jquery.js"></script>
  9. <script src="scripts/js/index.js"></script>
  10. </head>
  11.  
  12. <header>
  13.     <div class="wraper">
  14. <body>
  15. <div id="phonebar">
  16. <h1 class="logo">The TinyBits</h1>
  17. </div>
  18.  
  19.  
  20.    
  21.         <div id="slogan">
  22.             <br><br>
  23.             <h1>Learn, Create, Share and Explore </h1><br><br>
  24.             <h2>We are the club that dreamed to change Choutara.<br> And Let us connect you people from different places.</h2>
  25.             <h2>Hail TinyBits</h2>
  26.         </div>
  27.  
  28.    
  29.  
  30. <form  id="login_form" action="index.php" method="POST"><!--Login form-->
  31. <h1 class="login_head"> Login to TinyBits</h1><br><br><br><!--Login LOGO -->
  32.  
  33. <?php
  34.     if(isset($_POST['login'])){
  35.         if(empty($_POST['login_username']) || empty($_POST['login_password'])){
  36.             echo'<style>.warning{ color:#006699;  </style><p class="warning">Please enter proper username and password</p>';
  37.        
  38.     }else{
  39. require('includes/database/db.connect.php');
  40.     $username = mysql_real_escape_string($_POST['login_username']);
  41.     $password = mysql_real_escape_string($_POST['login_password']);
  42.     $query ="SELECT * FROM `members` WHERE `memberUsername` = '$username' AND `memberPassword` = '$password'";
  43.     if(mysql_num_rows(mysql_query($query))){
  44.         $result = mysql_query($query);
  45.             while($row = mysql_fetch_array($result)){
  46.                 $userid = $row['memberId'];
  47.             }
  48.             $expire = time()+60*60; //1 hour
  49.             setcookie("id",$userid,$expire);
  50.             header ('Location:dashboard.php');
  51.  
  52.         }else {
  53.             echo '<style>.warning{color:#006699;}</style><p class="warning">You are not registered please concern with you admin</p>';
  54.         }
  55.    
  56.  
  57. }
  58. }
  59. ?>
  60. <input class="login_field" placeholder="Enter Username" type ="text" name="login_username"><br><!--username-->
  61. <input class="login_field" placeholder="Enter Password" type="password" name="login_password"><br><!--password-->
  62. <input class="login" value="Login" type="Submit" name="login"><br><br><br><!--form submission-->
  63. <a id="create" href="create_user.php">Create an account </a>
  64. </form>
  65.  
  66. </div>
  67. <div>
  68.     <?php
  69.         include'includes/php/footer.php';
  70.     ?>
  71.    
  72. </div>
  73.  
  74. </body>
  75. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement