I'm trying to find out how to make a progress bar visualising the progress of the form being submitted. Now I find alot of articles where data is being submitted through AJAX/jQuery to a separate php file where the data is being parsed.
But how do I do this when the action attribute of the form is $_SERVER["PHP_SELF"] and the data is being processed with php in the same file. (After the submit button is pressed, the page refreshes.)
Example:
<?php
if(isset($_POST['submit']) && !empty($_POST['submit'])){
// some validation code combined with error_message array here
// uploading data to server and database here
}
?>
...
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="POST" id="aaa" enctype="multipart/form-data">
<input type="text" name="title" id="title" size="55" maxlength="55" required>
<textarea name="description" id="description" maxlength="155" rows="3" cols="55" required></textarea>
<input type="file" name="images[]" id="file_input">
<input type="file" name="images[]" id="file_input">
<input type="file" name="images[]" id="file_input">
<input type="submit" value="Submit" name="submit" id="submit">
</form>