0

嗨,我有以下代码,浏览器正在注释掉 php.ini。该文件保存为 .php 但没有任何帮助。我搜索了这个论坛,没有任何效果。

<html>
    <head>

    <!--<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>-->
        <title>
            Golden Acres
        </title>
        <link href="css/mystyle.css" rel="stylesheet" type="text/css"/>

    </head>
    <body class="center">
        <table class="main_tables">
            <tr>
                <td rowspan="2" >
                    <img class="main_logo" src="images/logo2.gif" alt="logo"/>
                </td>
                <td id="main_nav_menu"  valign="bottom">
                    <table cellspacing="2" >
                        <tr>
                            <td id="slogan_home" colspan="6" valign="middle">
                                "delivering fresh close to your home"

                            </td>
                        </tr>
                        <tr id="extra_row"><td></td></tr>
                        <tr>
                            <td class="main_nav_menu" align="center">
                                <a class="main_nav_menu_links"  href="index.html">home</a>
                            </td>
                            <td class="main_nav_menu">
                                <a class="main_nav_menu_links"  href="about_us.html">about us</a>
                            </td>
                            <td class="main_nav_menu" >
                                <a class="main_nav_menu_links" href="boxes.html">boxes</a>
                            </td>
                            <td class="main_nav_menu">
                                <a class="main_nav_menu_links" href="shop.html">Shop</a>
                            </td>
                            <td class="main_nav_menu">
                                <a class="main_nav_menu_links" href="events.html">events</a>
                            </td>
                            <td class="main_nav_menu">
                                <a class="main_nav_menu_links" href="contact.html">Contact Us</a>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <?php
            if(isset($_POST['submit'])){
            $submit = $_POST['submit'];

            if(isset($_POST['register_fname'])&&($_POST['register_lname'])&&($_POST['register_uname'])&&($_POST['register_password'])){
                $firstname = $_POST['register_fname'];
                $lastname = $_POST['register_lname'];
                $username = $_POST['register_uname'];
                $password = $_POST['register_password'];

                if(isset($firstname)&&isset($lastname)&&isset($username)&&isset($password)){
                    echo 'Isset is ok';
                }
                else
                {
                    echo 'Isset is not ok';
                }
            }
        }
        ?>
        <form action="register.php" method="POST">
        <input type="submit" name="submit">
    </form>
    </body>
</html>

当我在浏览器中检查元素时,它显示为:<!-- php .... ?-->

帮助将不胜感激。

4

2 回答 2

0

对不起,这是我的一个愚蠢的错误。

于 2013-09-23T21:13:54.097 回答
0

在页面的开头添加 Html 甚至 DOCTYPE 声明标记:

<?php include "register.php"; ?>
<!DOCTYPE html>
<html lang="en">

并将您的代码移动到此文件 < register.php >

然后使用如下形式:

<form id="" name="" method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>" role="form">
<input type="submit" name="submit" value="Send" >
</form>

我希望这个能帮上忙

于 2013-09-21T18:06:50.800 回答