HTML无法获取PHP文件

时间:2018-10-18 19:28:26

标签: php html scripting

我有我的HTML代码和PHP脚本编码,我认为这很好,但是每当我单击HTML代码上的提交反馈时,它只会显示直接的PHP代码,而实际上没有执行,我不确定我在做什么错

这是我的HTML

<!DOCTYPE html>
<html>
    <title>Joe Fossetta Question 1</title>
    <body>
        <form action="Question_1.php" method="get">
            Please complete this form to submit your feedback:
            <br><br>
            Name:
            <select name="Res">
                <option value="Mr" selected>Mr.</option>
                <option value="Mrs">Mrs.</option>
                <option value="Ms">Ms.</option>
            </select>
            <input type="text" name="name">
            <br><br>
            E-mail Address: <input type="text" name="email">
            <br><br>
            Phone Number: <input type="text" name="phone">
            <br><br>
            Rating:
            <input type="radio" name="rating" value="excellent" checked> excellent
            <input type="radio" name="rating" value="okay"> okay
            <input type="radio" name="rating" value="boring"> boring 
            <br><br>
            Comments:
            <input type="text" name="comments">
            <br><br>
            <input type="submit" value="Send My Feedback">
        </form>
    </body>
</html>

这是PHP脚本

<html>
    <body>
        Thank you, <?php echo $_GET["Res"]; ?>
        <?php echo $_GET["name"]; ?>,for your comments.
        <br>
        <br>
        Your email address is: <?php echo $_GET["email"]; ?>
        and your phone number is:<?php echo $_GET["phone"]; ?>
        <br>
        <br>
        You stated that you found this example to be '<?php echo $_GET["rating"]; ?>
        and added:<br><br><?php echo $_GET["commetns"]; ?>
    </body>
</html>

0 个答案:

没有答案