You cannot accept input in the middle of php execution, as it ends before the page is shown to the user. However, you can get input using HTML and get it using php. Here is a really basic example:
<?php echo $_POST['value']; ?> <form method="post" action=""> <input type="text" name="value"> <input type="submit"> </form>
It takes user input and reloads the page. Then he repeats what was at the entrance.
source share