Advertisement
Guest User

Untitled

a guest
May 10th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.08 KB | None | 0 0
  1. <?php
  2. session_start();
  3. virtual('/fadly_xrpl/wisata_2/Connections/connection.php');
  4. ?>
  5. <?php
  6. if (!function_exists("GetSQLValueString")) {
  7. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  8. {
  9.   if (PHP_VERSION < 6) {
  10.     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  11.   }
  12.  
  13.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  14.  
  15.   switch ($theType) {
  16.     case "text":
  17.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  18.       break;    
  19.     case "long":
  20.     case "int":
  21.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  22.       break;
  23.     case "double":
  24.       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  25.       break;
  26.     case "date":
  27.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  28.       break;
  29.     case "defined":
  30.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  31.       break;
  32.   }
  33.   return $theValue;
  34. }
  35. }
  36. ?>
  37. <?php
  38. // *** Validate request to login to this site.
  39. $loginFormAction = $_SERVER['PHP_SELF'];
  40. if (isset($_GET['accesscheck'])) {
  41.   $_SESSION['PrevUrl'] = $_GET['accesscheck'];
  42. }
  43.  
  44. if (isset($_POST['inputUsername3'])) {
  45.   $loginUsername=$_POST['inputUsername3'];
  46.   $password=$_POST['inputPassword3'];
  47.   $MM_fldUserAuthorization = "";
  48.   $MM_redirectLoginSuccess = "/fadly_xrpl/wisata_2/admin/index.php";
  49.   $MM_redirectLoginFailed = "index.php";
  50.   $MM_redirecttoReferrer = false;
  51.   mysql_select_db($database_connection, $connection);
  52.  
  53.   $LoginRS__query=sprintf("SELECT username, password FROM `user` WHERE username=%s AND password=%s",
  54.     GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
  55.    
  56.   $LoginRS = mysql_query($LoginRS__query, $connection) or die(mysql_error());
  57.   $loginFoundUser = mysql_num_rows($LoginRS);
  58.   if ($loginFoundUser) {
  59.      $loginStrGroup = "";
  60.    
  61.   if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
  62.     //declare two session variables and assign them
  63.     $_SESSION['MM_Username'] = $loginUsername;
  64.     $_SESSION['MM_UserGroup'] = $loginStrGroup;      
  65.  
  66.     if (isset($_SESSION['PrevUrl']) && false) {
  67.       $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];  
  68.     }
  69.     header("Location: " . $MM_redirectLoginSuccess );
  70.   }
  71.   else {
  72.     header("Location: ". $MM_redirectLoginFailed );
  73.   }
  74. }
  75. ?>
  76.  
  77.  
  78. <!DOCTYPE html>
  79. <html lang="en">
  80. <head>
  81.     <!-- Required meta tags -->
  82.     <meta charset="utf-8">
  83.     <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  84. <script src="js/jquery.min.js" crossorigin="anonymous"></script>
  85. <script src="js/tether.min.js" crossorigin="anonymous"></script>
  86. <script src="js/bootstrap.min.js"  crossorigin="anonymous"></script>
  87.     <link rel="stylesheet" href="css/bootstrap.min.css" crossorigin="anonymous">
  88.     <link href="gui.css" rel="stylesheet" type="text/css">
  89. </head>
  90.   <body>
  91.  
  92.     <nav class="navbar navbar-toggleable-md navbar-inverse fixed-top bg-primary">
  93.       <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
  94.         <span class="navbar-toggler-icon"></span>
  95.       </button>
  96.       <a class="navbar-brand" href="#">Navbar</a>
  97.  
  98.       <div class="collapse navbar-collapse" id="navbarsExampleDefault">
  99.         <ul class="navbar-nav mr-auto">
  100.           <li class="nav-item active">
  101.             <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
  102.           </li>
  103.           <li class="nav-item">
  104.             <a class="nav-link" href="#">Link</a>
  105.           </li>
  106.           <li class="nav-item">
  107.             <a class="nav-link disabled" href="#">Disabled</a>
  108.           </li>
  109.           <li class="nav-item dropdown">
  110.             <a class="nav-link dropdown-toggle" href="#" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
  111.             <div class="dropdown-menu" aria-labelledby="dropdown01">
  112.               <a class="dropdown-item" href="#">Action</a>
  113.               <a class="dropdown-item" href="#">Another action</a>
  114.               <a class="dropdown-item" href="#">Something else here</a>
  115.             </div>
  116.           </li>
  117.           </ul>
  118.           <span class="btn-group">
  119.             <a class="nav-link btn-success" href="#" id="login" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Login</a>
  120.             <div class="dropdown-menu dropdown-menu-right" aria-labelledby="login">
  121.             <form ACTION="<?php echo $loginFormAction; ?>" METHOD="POST" name="login">
  122.                 <div class="container login">
  123.                     <div class="form-group">
  124.                       <label for="inputEmail3" class="col-sm col-form-label justify-content-end">Email</label>
  125.                       <div class="col-sm justify-content-end">
  126.                         <input type="text" class="form-control" id="inputUsername3" placeholder="Username">
  127.                       </div>
  128.                     </div>
  129.                     <div class="form-group">
  130.                       <label for="inputPassword3" class="col-sm col-form-label justify-content-end">Password</label>
  131.                       <div class="col-sm justify-content-end">
  132.                         <input type="password" class="form-control" id="inputPassword3" placeholder="Password">
  133.                       </div>
  134.                     </div>
  135.                    
  136.                     <input type="submit" class="col-sm btn btn-success justify-content-center" value="Login"></input>
  137.                 </div>
  138.              </form>
  139.           </div>
  140.           </span>
  141.       </div>
  142.   </nav>
  143.  
  144.  
  145.  
  146.     <div class="container-fluid">
  147.         <div class="row body">
  148.           <div class="col-12 col-md-10 bg-faded left-side">col-8
  149.           </div>
  150.           <div class="col-12 col-md-2 bg-inverse text-white right-side">col-4</div>
  151.         </div>
  152.     </div>
  153. </body>
  154. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement