Skip to content

Instantly share code, notes, and snippets.

<?php session_start();?>
<?php include 'db.php';
if(isset($_SESSION['display_name'])){
$username = $_SESSION['username'];
$display_name = $_SESSION['display_name'];
}
?>
<?php include 'db.php';
try{
if(isset($_GET['makelive'])){
$index = $_GET['makelive'];
$query = $connection->prepare("
<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">
<?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)) {
$uploadedFile = "uploads/out.upz";
$handle = fopen($uploadedFile, 'rb');
if( ! $handle ) {
throw new Exception( "Can't open file" );
}
$buffer = fread( $handle, 14 );
$uploadedFile = "uploads/out.upz";
$handle = fopen($uploadedFile, 'rb');
if( ! $handle ) {
throw new Exception( "Can't open file" );
}
$buffer = fread( $handle, 14 );
echo "<br><br>";
<?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)) {
<form action="" method="post">
<div class="form-group">
<?php
if(isset($_GET['edit'])){
$user_id = $_GET['edit'];
//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
function addUser(){
global $connection;
if(isset($_POST['submit'])){
$username = $_POST['username'];
$password = $_POST['password'];
$display_name = $_POST['display_name'];
$email = $_POST['email'];