Skip to content

Commit

Permalink
Fix for contact email form
Browse files Browse the repository at this point in the history
  • Loading branch information
Coliwob committed Jun 3, 2021
1 parent 5e4e79d commit e0a0b9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contact/includes/contact.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ function input_filter($data) {
}

//check if the message is longer than 20 characters.
elseif(strlen($msg) >= 20){
elseif(strlen($msg) <= 20){

$_SESSION['ERRORS']['mailstatus'] = 'Message should be longer than 20 characters';
header("Location: ../");
exit();
}

//check if the message is shorter than 500 characters.
elseif(strlen($msg) <= 500){
elseif(strlen($msg) >= 500){

$_SESSION['ERRORS']['mailstatus'] = 'Message should be shorter than 500 characters';
header("Location: ../");
Expand Down
7 changes: 7 additions & 0 deletions contact/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@

?>
</small>
<small class="text-danger font-weight-bold">
<?php
if (isset($_SESSION['ERRORS']['mailstatus']))
echo $_SESSION['ERRORS']['mailstatus'];

?>
</small>
</div>

<?php if(!isset($_SESSION['auth'])) { ?>
Expand Down

0 comments on commit e0a0b9e

Please sign in to comment.