-5

好的,所以我制作了一个登录系统,由于某种原因,当我像这样输入时遇到问题,它在没有回显或打印的情况下发布,下面的脚本显示本身可以帮助任何人。

<?PHP $form = '
 <form method="POST" action="login.php">
<table>
    <tr>
        <td>Username:<td>
        <td><input type="text" name="user"><td>
    </tr>
    <tr>
        <td>Password:<td>
        <td><input type="password" name="password"><td>
    </tr>
    <tr>
        <td><td>
        <td><input type="submit" name="loginbtn" value="Login"><td>
    </tr>
    <tr>
        <td><a href="register.php">Register</a><td>
        <td><a href="forgotpass.php">Forgoten Password</a><td>
    </tr>
</table>
</form>'
;
?>
4

1 回答 1

2
<?php //Some PHP Code if necessary 
if(true) { //Any html between this brace and the next brace will be included

?>

<form method="POST" action="login.php">
    <table>
        <tr>
            <td>Username:<td><td>
            <input type="text" name="user">
            <td>
        </tr>
        <tr>
            <td>Password:<td><td>
            <input type="password" name="password">
            <td>
        </tr>
        <tr>
            <td><td><td>
            <input type="submit" name="loginbtn" value="Login">
            <td>
        </tr>
        <tr>
            <td><a href="register.php">Register</a><td><td><a href="forgotpass.php">Forgoten Password</a><td>
        </tr>
    </table>
</form>
<?php
} //End of if statement.
else { //This won't be shown, because the if statement is always true
?>
<div>
    This is not displayed
</div>

<?php
}
?>
于 2013-07-29T17:58:56.783 回答