I making a PHP script which is powered by a POST request mainly, and it shows an HTML form which is like a command prompt, how can I simulate the text adding? I mean something like this (Mac OS X Terminal):

This is my code:
HTML:
<!DOCTYPE html>
<html lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Terminal</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<?php
include("co.php");
echo $prompt;
?>
</body>
</html>
PHP:
<?php
$command=$_POST['command'];
echo "<!DOCTYPE html>
<html lang=\"es\">
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
<title>Terminal</title>
<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />
</head>";
$prompt .= "<header><p>Today is: ".date("M d")." of ".date("o")."</p><p class=\"command\"><label><form method=\"post\" action=\"".$_SERVER['PHP_SELF']."\" autocomplete=OFF>www@".$_SERVER['SERVER_NAME'].":~$><input name=\"command\" type=\"text\" id=\"command\" size=\"40\" maxlength=\"500\" autofocus></label></form></p></header>";
$commandexp = explode(" ", $command);
if($commandexp[0] === "echo") {
$prompt .= $prompt.$commandexp[1].$prompt;
echo $prompt;
} else {
echo "command not found";
}
?>
Thanks in advance 🙂
Add a textbox field with no border and transparent background at the end of your command lines
and when user hits “enter”, it sends the post request and refresh the list.