Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <?php
- session_start();
- if ($_SESSION['user_logged_in'] == ''){
- header('location: login.html');
- }
- ?>
- <html>
- <head>
- <title>.::PkKit::.</title>
- <!-- BootStrap -->
- <!-- Latest compiled and minified CSS -->
- <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
- <!-- jQuery library -->
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
- <!-- Latest compiled JavaScript -->
- <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="style.css" type="text/css" />
- <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700|Lato:400,100,300,700,900' rel='stylesheet' type='text/css'>
- <link rel="stylesheet" href="css/animate.css">
- <link rel="stylesheet" href="css/style.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
- </head>
- <body>
- <nav class="navbar navbar-inverse">
- <div class="container-fluid">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <a class="navbar-brand" href="#">PKKIT</a>
- </div>
- <div class="collapse navbar-collapse" id="myNavbar">
- <ul class="nav navbar-nav">
- <li class="active"><a href="myphotos.php">My Photos</a></li>
- <li><a href="aboutus.php">About Us</a></li>
- <li><a href="faqs.php">FAQs</a></li>
- <li><a href="support.php">Support</a></li>
- </ul>
- <ul class="nav navbar-nav navbar-right">
- <li><a href="create.php"><span class="glyphicon glyphicon-picture"></span> Create Album</a></li>
- <li><a href="logout.php"><span class="glyphicon glyphicon-log-out"></span> Logout</a></li>
- </ul>
- </div>
- </div>
- </nav>
- <ul>
- <div id="body" class="container-fluid">
- <div class="login-box animated fadeInUp">
- <div class="box-header">
- <h2>Create an album</h2>
- </div>
- <!-- Create the album in the database !-->
- <?php
- $AccountID = "\"" . $_SESSION['AccountID'] . "\""; // Global logged in user
- $idName= "\"" . $_POST['Title'] . "\""; // Grab the data from form post
- $Description = "\"" . $_POST['Description'] . "\"";
- $servername = "localhost";
- $username = "PKKIT"; // Set up the SQL server details.
- $password = "jeznicklogan";
- $dbname = "PKKIT";
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- $sql = "INSERT INTO album (album_title, album_desc) VALUES (" . $idName . ", " . $Description . ");";
- if (mysqli_multi_query($conn, $sql)) {
- $last_id = mysqli_insert_id($conn);
- $sql = "INSERT INTO album_perm (album_id, account_id, perm_type) VALUES (" . "\"" . $last_id . "\"," . $AccountID . ",1);";
- //print_r($_SESSION);
- } else {
- echo "<label>Your album could not be created.</label><br /><br />";
- }
- if (mysqli_multi_query($conn, $sql)){
- echo "<label>Your album has been created successfully </label><br /><br />";
- } else {
- echo "<label>Could not set permissions on album</label><br /><br />";
- }
- mysqli_close($conn); // close the sql connection
- ?>
- <a href="myphotos.php"><p class="small">OK</p></a>
- </div>
- </div>
- </div>
- <script>
- $(document).ready(function () {
- $('#logo').addClass('animated fadeInDown');
- $("input:text:visible:first").focus();
- });
- $('#username').focus(function() {
- $('label[for="username"]').addClass('selected');
- });
- $('#username').blur(function() {
- $('label[for="username"]').removeClass('selected');
- });
- $('#password').focus(function() {
- $('label[for="password"]').addClass('selected');
- });
- $('#password').blur(function() {
- $('label[for="password"]').removeClass('selected');
- });
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement