Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.48 KB | None | 0 0
  1. <?php
  2. session_start();
  3. require_once("security.php");
  4. new security(array(
  5.     "get" => TRUE,
  6.     "post" => TRUE,
  7.     "cookie" => TRUE,
  8.     "session" => TRUE
  9. ));
  10.  
  11. $host = "localhost";
  12. $user = "root";
  13. $password = "";
  14. $db = "vvp";
  15.  
  16. try {
  17.     $con = new PDO("mysql:host=$host;dbname=$db;",$user,$password);
  18.     $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  19.  
  20.  
  21. function protect( $string ) {
  22.     return mysql_real_escape_string(htmlspecialchars(stripslashes(strip_tags($string))));
  23. }
  24. function ar_on () {
  25.     if(!isset($_SESSION['uid'])) {
  26.         header("Location: index.php");
  27.     }
  28. }
  29.  
  30. if(isset($_GET['id'])) {
  31.     $id = protect($_GET['id']);
  32. }else{
  33.     $id = "";
  34. }
  35. if(isset($_GET['id2'])) {
  36.     $id2 = protect($_GET['id2']);
  37. }else{
  38.     $id2 = "";
  39. }
  40. if(isset($_GET['id3'])) {
  41.     $id3 = protect($_GET['id3']);
  42. }else{
  43.     $id3 = "";
  44. }
  45.  
  46. if(isset($_SESSION['uid'])) {
  47.  
  48.     $sql = $con->prepare("SELECT * FROM `user` WHERE `id`= ? ");
  49.     $sql->execute(array($_SESSION['uid']));
  50.     $q = $sql->fetch(PDO::FETCH_OBJ);
  51.    
  52. }
  53. }
  54. catch(PDOException $e)
  55. {
  56.     echo $e->getMessage();
  57. }
  58. ?>
  59. <head>
  60.         <meta charset="utf-8">
  61.         <meta http-equiv="X-UA-Compatible" content="IE=edge">
  62.         <meta name="viewport" content="width=device-width, initial-scale=1">
  63.         <title>Vartotojo Valdymo sistema</title>
  64.         <link href="css/bootstrap.min.css" rel="stylesheet">
  65.        
  66.     </head>
  67. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  68.         <script src="js/bootstrap.min.js"></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement