我有一个表,其中记录了html代码,当我将其显示为字符串形式的图片时,如何使用PHP将html代码呈现到页面上
html的示例是
<pre class="prettyprint linenums"><code>else { echo '<form = "nav-login" method="post" onsubmit="return noEmptyUserFields();" action="includes/login.inc.php"> <input type="text" id="uidz" name="uid" placeholder="Username/e-mail"> <input type="password" id="pwdz" name="pwd" placeholder="password"> <button type="submit" name="submit">Login</button> </form> <a href="signup.php">Sign up</a>'; } </code></pre> <p><strong>But it responds to my javascript which is outside of the php which looks like this:</strong></p> <pre class="prettyprint linenums"><code><form class="signup-form" method="post" onsubmit="return noEmptyUserFields();" action="includes/signup.inc.php"> <input type="text" id="first" name="first" placeholder="Firstname"> <input type="text" id="last" name="last" placeholder="Lastname" > <input type="email" id="email" name="email" placeholder="E-mail" > <input type="text" id="uid" name="uid" placeholder="Username" > <input type="password" id="pwd" name="pwd" placeholder="Password" ></p2> <button type="submit" name="submit">Sign up</button></form> </code></pre>
简而言之,它的行为类似于字符串,但我想在页面上显示