mirror of
https://github.com/Anvilcraft/jensmemes
synced 2025-03-19 23:20:25 +01:00
Update upload.php
Fixed Upload limit
This commit is contained in:
parent
125420490c
commit
4e40206b22
1 changed files with 10 additions and 9 deletions
|
@ -7,14 +7,6 @@ if (isset($_POST['submit'])) {
|
|||
$home_dir = "images/" . md5($tokencookie) . "/";
|
||||
mkdir($home_dir);
|
||||
|
||||
$resultMaxUpl = mysqli_query($con, "select * from token WHERE token='$tokencookie' OR token='$tokenpost'") or die('Error In Session');
|
||||
$rowMaxUpl = mysqli_fetch_array($resultMaxUpl);
|
||||
$MaxUpl = $rowMaxUpl['uploadsLast24H'];
|
||||
$MaxUpl++;
|
||||
$sqlMaxUpl = "UPDATE token SET uploadsLast24H='$MaxUpl' WHERE token='$tokencookie' OR token='$tokenpost'";
|
||||
mysqli_query($con, $sqlMaxUpl);
|
||||
|
||||
|
||||
$resultToken=mysqli_query($con, "select * from token WHERE token='$tokencookie' OR token='$tokenpost'")or die('ERR_resultToken');
|
||||
$rowToken=mysqli_fetch_array($resultToken);
|
||||
|
||||
|
@ -24,6 +16,15 @@ if (isset($_POST['submit'])) {
|
|||
if ($MaxUpl <= 20) {
|
||||
$countfiles = count($_FILES['file']['name']);
|
||||
for ($i = 0; $i < $countfiles; $i++) {
|
||||
|
||||
$resultMaxUpl = mysqli_query($con, "select * from token WHERE token='$tokencookie' OR token='$tokenpost'") or die('Error In Session');
|
||||
$rowMaxUpl = mysqli_fetch_array($resultMaxUpl);
|
||||
$MaxUpl = $rowMaxUpl['uploadsLast24H'];
|
||||
$MaxUpl++;
|
||||
$sqlMaxUpl = "UPDATE token SET uploadsLast24H='$MaxUpl' WHERE token='$tokencookie' OR token='$tokenpost'";
|
||||
mysqli_query($con, $sqlMaxUpl);
|
||||
|
||||
|
||||
$filename = $_FILES['file']['name'][$i];
|
||||
move_uploaded_file($_FILES['file']['tmp_name'][$i], $home_dir . $filename);
|
||||
|
||||
|
@ -50,4 +51,4 @@ if (isset($_POST['submit'])) {
|
|||
echo "Unautorized!";
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
Loading…
Add table
Reference in a new issue