可以用HTML或PHP在输入框中存储变量吗

可以用HTML或PHP在输入框中存储变量吗,php,html,variables,input,Php,Html,Variables,Input,我想创建一个输入框,只有可读性和书名,有可能输入框可以存储一个变量吗 另外,我想更改的是id,现在我成功地禁用了输入框,但是输出是$id,而不是我使用$GET方法的变量 我的代码如下 <?php include_once 'header.php'; $id = mysqli_real_escape_string($conn, $_GET['bookid']); $title = mysqli_real_escape_string($conn, $_GET['title'

我想创建一个输入框,只有可读性和书名,有可能输入框可以存储一个变量吗

另外,我想更改的是id,现在我成功地禁用了输入框,但是输出是$id,而不是我使用$GET方法的变量

我的代码如下

<?php
  include_once 'header.php';
    $id = mysqli_real_escape_string($conn, $_GET['bookid']);
    $title = mysqli_real_escape_string($conn, $_GET['title']);
?>

<section class="signup-form">
  <h2>Pre-order</h2>
  <div class="signup-form-form">
    <form action="preorder.inc.php" method="post">
        <input type="text" disabled="disabled" name="id" value= $id >
      <input type="text" name="uid" placeholder="Username...">
      <input type="text" name="BRO" placeholder="BookRegistrationCode...">
      <button type="submit" name="submit">Pre-order</button>
    </form>
  </div>
  <?php
    // Error messages
     if (isset($_GET["error"])) {
      if ($_GET["error"] == "emptyinput") {
        echo "<p>Fill in all fields!</p>";
      }
      else if ($_GET["error"] == "wronginfo") {
        echo "<p>Wrong information!</p>";
      }
        else if ($_GET["error"] == "stmtfailed") {
        echo "<p>Something went wrong!</p>";
      }
      else if ($_GET["error"] == "none") {
        echo "<p>Success!</p>";
      }
     }
  ?>
</section>

预购
预购
放入value属性中

这里有一个使用“php短标记”的提示: