Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require_once("security.php");
- new security(array(
- "get" => TRUE,
- "post" => TRUE,
- "cookie" => TRUE,
- "session" => TRUE
- ));
- $host = "localhost";
- $user = "root";
- $password = "";
- $db = "vvp";
- try {
- $con = new PDO("mysql:host=$host;dbname=$db;",$user,$password);
- $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- function protect( $string ) {
- return mysql_real_escape_string(htmlspecialchars(stripslashes(strip_tags($string))));
- }
- function ar_on () {
- if(!isset($_SESSION['uid'])) {
- header("Location: index.php");
- }
- }
- if(isset($_GET['id'])) {
- $id = protect($_GET['id']);
- }else{
- $id = "";
- }
- if(isset($_GET['id2'])) {
- $id2 = protect($_GET['id2']);
- }else{
- $id2 = "";
- }
- if(isset($_GET['id3'])) {
- $id3 = protect($_GET['id3']);
- }else{
- $id3 = "";
- }
- if(isset($_SESSION['uid'])) {
- $sql = $con->prepare("SELECT * FROM `user` WHERE `id`= ? ");
- $sql->execute(array($_SESSION['uid']));
- $q = $sql->fetch(PDO::FETCH_OBJ);
- }
- }
- catch(PDOException $e)
- {
- echo $e->getMessage();
- }
- ?>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Vartotojo Valdymo sistema</title>
- <link href="css/bootstrap.min.css" rel="stylesheet">
- </head>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
- <script src="js/bootstrap.min.js"></script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement