This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php session_start();?> | |
<?php include 'db.php'; | |
if(isset($_SESSION['display_name'])){ | |
$username = $_SESSION['username']; | |
$display_name = $_SESSION['display_name']; | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include 'db.php'; | |
try{ | |
if(isset($_GET['makelive'])){ | |
$index = $_GET['makelive']; | |
$query = $connection->prepare(" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form class="well" action="includes/upload.php" method="post" enctype="multipart/form-data"> | |
<div class="form-group"> | |
<label for="fileToUpload">Upload Update</label> | |
<input type="file" name="fileToUpload" id="fileToUpload"> | |
</div> | |
<div class="form-group"> | |
<label for="git">GIT</label> | |
<input class="form-control" type="text" name="git"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$target_dir = "uploads/"; | |
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); | |
$uploadOk = 1; | |
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); | |
// Check if image file is a actual image or fake image | |
if(isset($_POST["submit"])) { | |
// Check if file already exists | |
if (file_exists($target_file)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$uploadedFile = "uploads/out.upz"; | |
$handle = fopen($uploadedFile, 'rb'); | |
if( ! $handle ) { | |
throw new Exception( "Can't open file" ); | |
} | |
$buffer = fread( $handle, 14 ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$uploadedFile = "uploads/out.upz"; | |
$handle = fopen($uploadedFile, 'rb'); | |
if( ! $handle ) { | |
throw new Exception( "Can't open file" ); | |
} | |
$buffer = fread( $handle, 14 ); | |
echo "<br><br>"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$target_dir = "uploads/"; | |
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); | |
$uploadOk = 1; | |
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); | |
// Check if image file is a actual image or fake image | |
if(isset($_POST["submit"])) { | |
// Check if file already exists | |
if (file_exists($target_file)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="" method="post"> | |
<div class="form-group"> | |
<?php | |
if(isset($_GET['edit'])){ | |
$user_id = $_GET['edit']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//UPDATE QUERY | |
if(isset($_POST['update_users'])){ | |
$get_user = $_POST['username']; | |
$get_display_name = $_POST['display_name']; | |
$get_email = $_POST['email']; | |
$query = $connection->prepare(" | |
UPDATE users SET username = :username, display_name = :display_name, email = :email |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addUser(){ | |
global $connection; | |
if(isset($_POST['submit'])){ | |
$username = $_POST['username']; | |
$password = $_POST['password']; | |
$display_name = $_POST['display_name']; | |
$email = $_POST['email']; |