Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if(isset($_COOKIE['id'])){
- $COOKIE['id']= $userid;
- header('Location:dashboard.php');
- } ?>
- <html>
- <head><marquee><title>TinyBits || Welcome To TinyBits</title></marquee>
- <link rel="stylesheet" href="scripts/css/index_css.css">
- <script src="scripts/js/jquery.js"></script>
- <script src="scripts/js/index.js"></script>
- </head>
- <header>
- <div class="wraper">
- <body>
- <div id="phonebar">
- <h1 class="logo">The TinyBits</h1>
- </div>
- <div id="slogan">
- <br><br>
- <h1>Learn, Create, Share and Explore </h1><br><br>
- <h2>We are the club that dreamed to change Choutara.<br> And Let us connect you people from different places.</h2>
- <h2>Hail TinyBits</h2>
- </div>
- <form id="login_form" action="index.php" method="POST"><!--Login form-->
- <h1 class="login_head"> Login to TinyBits</h1><br><br><br><!--Login LOGO -->
- <?php
- if(isset($_POST['login'])){
- if(empty($_POST['login_username']) || empty($_POST['login_password'])){
- echo'<style>.warning{ color:#006699; </style><p class="warning">Please enter proper username and password</p>';
- }else{
- require('includes/database/db.connect.php');
- $username = mysql_real_escape_string($_POST['login_username']);
- $password = mysql_real_escape_string($_POST['login_password']);
- $query ="SELECT * FROM `members` WHERE `memberUsername` = '$username' AND `memberPassword` = '$password'";
- if(mysql_num_rows(mysql_query($query))){
- $result = mysql_query($query);
- while($row = mysql_fetch_array($result)){
- $userid = $row['memberId'];
- }
- $expire = time()+60*60; //1 hour
- setcookie("id",$userid,$expire);
- header ('Location:dashboard.php');
- }else {
- echo '<style>.warning{color:#006699;}</style><p class="warning">You are not registered please concern with you admin</p>';
- }
- }
- }
- ?>
- <input class="login_field" placeholder="Enter Username" type ="text" name="login_username"><br><!--username-->
- <input class="login_field" placeholder="Enter Password" type="password" name="login_password"><br><!--password-->
- <input class="login" value="Login" type="Submit" name="login"><br><br><br><!--form submission-->
- <a id="create" href="create_user.php">Create an account </a>
- </form>
- </div>
- <div>
- <?php
- include'includes/php/footer.php';
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement