I have a form in my PHP script which only has a submit button. When clicked it refreshes the page and calls a function that I created. Before the function I am echoing some text, but it is not showing the text and goes to the function and completes it first (which may take 10 to 20 seconds). All that shows on the screen is the depressed submit button.
I have a couple of other functions which are called from previous functions with text before them as well, but same thing, all the text shows up after all the functions have completed what they are doing.
I just don't want the user clicking on things thinking nothing is happening, so the text is just a blurb that the process is working.
Am I missing something? Is this a PHP or a form thing.
Thanks
<?php
if(isset($_POST["section"]) && $_POST["section"] == "Install") {
echo "<p class='install'>Working.......<br></p>";
Database($db);
}
else {
echo "<p class='install'>Welcome to IMS setup. Please follow the instructions and enter any information as requested for a smooth installation. If you haven't done so already edit lines 4, 5 and 6 of this file to
match your MySQL login credentials. DO NOT change any other setting in this file. Click Install when you are ready to start.</p>
<p>
<form action='install.php' method='post'>
<input type='submit' name='section' class='button button-primary' style='width: 12%' value='Install'>
</form>
</p>";
}
function Database($db) {
echo "In Progress";
create DB and Tables code
Populate($db);
}
Populate($db) {
echo "In Progress";
Enter stuff in the tables.
next table etc.
} ?>