提交后,如何使“MadLibs”表单结果显示在表单字段下方?

Thanks in advance for your help. I've searched a lot before posting this but I end up more confused than when I started :)

I'm trying to have one page contain the form fields and after pressing submit, the resulting story with user's form field entries inserted into the story.

It would be great to have the text from the form fields remain so that the user doesn't need to retype everything if they need to change a word or two.

I really appreciate your help. Hopefully this will help many people at once.

<html>
  <head>
    <title>My MadLib</title>
  </head>
    <body>
      <h1>MadLib</h1>
         <?php  if (isset($_POST['action']) && $_POST['action'] == "show"): ?>
  <p>Hello, I am a <?php  echo $_POST['adj']  ?> computer that owns a <?php  echo $_POST['noun']  ?>.</p>
    <?php else : ?>
      <form action="madlib.php" method="post">
        <input type="hidden" name="action" value="show">
          <p>An adjective: <input type="text" name="adj"></p>
    **strong text**      <p>A noun: <input type="text" name="noun"></p>
          <p><input type="submit" value="Go!"></p>
      </form>
    <?php  endif  ?>
  </body>
</html>

As you said you don't want to "keep it simple", you may simply add the needed value attribute to each of your <input>s, like this:

<html>
  <head>
    <title>My MadLib</title>
  </head>
    <body>
      <h1>MadLib</h1>
<?php
if (isset($_POST['action']) && $_POST['action'] == "show") {
?>
      <p>Hello, I am a <?php echo @$_POST['adj']; ?> computer that owns a <?php echo @$_POST['noun']; ?>.</p>
<?php
} else {
?>
      <form action="madlib.php" method="post">
        <input type="hidden" name="action" value="show">
          <p>An adjective: <input type="text" name="adj" value="<?php echo @$_POST['adj']"; ?> /></p>
          **strong text**
          <p>A noun: <input type="text" name="noun" value="<?php echo @$_POST['noun']"; ?> /></p>
          <p><input type="submit" value="Go!"></p>
      </form>
<?php
}
?>
  </body>
</html>

Note the (sometimes unloved) "@" to prevent firing a notice when $_POST['...'] doesn't exist yet. I also added the same in your <p>Hello... line.