Ich habe einen Code geschrieben und es passiert leider absolut nichts. Der Code geht um einen Upload.
PHP
<style>
.noperm{
font-family: sans-serif;
color: red;
margin-top: 23%;
}
h3{
font-family: sans-serif;
}
p{
font-family: sans-serif;
}
</style>
<link rel="stylesheet" href="styles/bootstrap.css">
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
include('upload.php');
include('phpSkripte/login.php');
$conn = mysqli_connect("localhost", "root", "", "einloggen");
$user_check = $_SESSION['login_user'];
$ergebnis = mysqli_query($conn, "SELECT rechte FROM login WHERE username = '$user_check'");
$row = mysqli_fetch_assoc($ergebnis);
$login_session = $row['username'];
if ($row['rechte'] >= 1) {
?>
<form method="POST" enctype="multipart/form-data">
<center><div class="file"><input type="file" name="file" id="file"> </div>
<br>
<select class="form-control" id="path" name="path">
<option>qb1/1</option>
<option>qb1/2</option>
<option>qb1/3</option>
<option>qb1/4</option>
<option>qb1/5</option>
<option>qb1/6</option>
<option>qb2/1</option>
<option>qb2/2</option>
<option>qb2/3</option>
<option>qb3/1</option>
<option>qb3/2</option>
<option>qb3/3</option>
<option>qb4</option>
</select>
</center>
<br>
<center><div class="submit"><input type="submit" value="Hochladen" id="button"></div></center>
<br>
<br>
</form>
<?php
echo $_POST["path"];
}else {
?><center><h1 class="noperm">ZUGRIFF VERWEIGERT!</h1><center><?php
}
?>
<?php
if(isset($_POST["submit"])){
$error = $_FILES['userfile']['error'];
$file = $_FILES["file"];
$path = $_POST['path'];
echo $path;
switch ($path) {
case 'qb1/1':
move_uploaded_file($file["tmp_name"], "uploads/qb1/1/" . $file["name"]);
break;
case 'qb1/2':
move_uploaded_file($file["tmp_name"], "uploads/qb1/2/" . $file["name"]);
break;
case 'qb1/3':
move_uploaded_file($file["tmp_name"], "uploads/qb1/3/" . $file["name"]);
break;
case 'qb1/4':
move_uploaded_file($file["tmp_name"], "uploads/qb1/4/" . $file["name"]);
break;
case 'qb1/5':
move_uploaded_file($file["tmp_name"], "uploads/qb1/5/" . $file["name"]);
break;
case 'qb1/6':
move_uploaded_file($file["tmp_name"], "uploads/qb1/6/" . $file["name"]);
break;
case 'qb2/1':
move_uploaded_file($file["tmp_name"], "uploads/qb2/1/" . $file["name"]);
break;
case 'qb2/2':
move_uploaded_file($file["tmp_name"], "uploads/qb2/2/" . $file["name"]);
break;
case 'qb2/3':
move_uploaded_file($file["tmp_name"], "uploads/qb2/3/" . $file["name"]);
break;
case 'qb3/1':
move_uploaded_file($file["tmp_name"], "uploads/qb3/1/" . $file["name"]);
break;
case 'qb3/2':
move_uploaded_file($file["tmp_name"], "uploads/qb3/2/" . $file["name"]);
break;
case 'qb3/3':
move_uploaded_file($file["tmp_name"], "uploads/qb3/3/" . $file["name"]);
break;
case 'qb4':
move_uploaded_file($file["tmp_name"], "uploads/qb4/" . $file["name"]);
break;
}
header("location: uploadroot.php");
echo $error;
}
?>
Alles anzeigen