Code cleany cleany

This commit is contained in:
Michał Gdula 2022-09-25 15:49:11 +00:00
parent 7308f669a5
commit a9780f59e7
6 changed files with 48 additions and 20 deletions

View file

@ -125,10 +125,10 @@ if (isset($_POST['submit_login'])) {
// let the user know
?>
<script>
sniffleAdd('O hi <?php echo $_SESSION["username"]; ?>', 'You are now logged in! You will be redirected in a few seconds', 'var(--green)', 'assets/icons/hand-waving.svg');
setTimeout(function(){window.location.href = "index.php";}, 2000);
window.location.href = "index.php";
</script>
<?php
$_SESSION['welc'] = true;
mysqli_query($conn,"INSERT INTO logs (ipaddress, action) VALUES('$user_ip','New loggin to ".$_SESSION['username']."')");

View file

@ -37,7 +37,7 @@ class Make {
$string = preg_replace('/ +/', ' ', $string);
$string = explode(" ", $string);
$string = explode(' ', $string);
$string_list = array();
foreach ($string as $i) {
@ -46,9 +46,9 @@ class Make {
}
}
$string = implode(" ", $string_list);
$string = implode(' ', $string_list);
return $string;
return trim($string);
}
}

View file

@ -39,12 +39,10 @@ if (isset($_POST['group_submit'])) {
if (mysqli_stmt_execute($stmt)) {
?>
<script>
sniffleAdd('Success!!!', 'Updates the image group! Redirecting.... soon', 'var(--green)', 'assets/icons/check.svg');
setTimeout(function() {
window.location.href = "group.php?id=<?php echo $_POST['group_id']; ?>";
}, 2000);
window.location.href = "group.php?id=<?php echo $_POST['group_id']; ?>";
</script>
<?php
$_SESSION['msg'] = "Updated the image group!";
} else {
?>
<script>
@ -132,6 +130,7 @@ if (isset($_POST['new_group_submit'])) {
window.location.href = "group.php?id=<?php echo $group_id; ?>";
</script>
<?php
$_SESSION['msg'] = "New Group successfully made!";
} else {
?>
<script>