HTML表单在php脚本中不起作用?

时间:2014-06-30 02:31:43

标签: php html forms

好的我是php的新手,我制作了这个脚本

<?php
include ('abcd.php');   

echo    '<html>
            <head>
                <title>Amul Eazy Registration</title>
                <style type="text/css">
                    body {

                        background-color: #22274f;
                        text-align: center;
                    }

                    div.main {
                        text-align: center;
                        padding-left: 400px;

                    } 

                    div.block {
                        text-align: center;
                        height: 250px;
                        width: 468px;
                        background-color: #14193c;
                        color: white;
                        font-family: Tahoma, Geneva, sans-serif;
                        font-size: 20px;
                        font-weight: 400;
                        padding-top: 40px;




                    }

                    div {

                        margin: 10px;
                        padding-bottom: 10px;
                        width: 300px;
                        padding-left: 50px;
                    }

                    .title {
                        float: left;
                        width: 140px;
                        text-align: left;
                        padding-right: 10px;
                    }

                    div.header {

                        height: 50px;
                        padding-left: 150px;
                        padding-top: 30px;              
                    }

                    div.logo {

                        height: 44px;
                        width: 199px;
                        background-image: url("image.png");
                        background-repeat: no-repeat;


                    }

                    div.credits {
                        height: 100px;
                        padding-left: 50px;
                    }

                    div.image {
                        float: right;
                    }
                    div.captcha{
                        background-image: url("'.$path.'");
                        background-repeat: no-repeat;

                    }
                    p.cred {
                        font-size: 30px;
                        color: #0083aa;
                        font-family: Georgia, Times, serif;
                        text-shadow: 2px 2px 7px #111111;

                    }

                    input[type=submit] {
                            width: 288px;
                            height: 45px;
                            background: url("create-account-button.png") no-repeat scroll 0% 0% transparent;
                            border: 0px none;
                            cursor: pointer;
                            outline: medium none;
                            font-family: "AccordAlternateBold";
                            font-size: 22px;
                            font-weight: 800;
                            text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
                            line-height: 40px;
                            color: #FFF;
                            text-align: center;
                                                        }

                    input[type=submit]:hover {
                            width:288px;
                            height:45px;
                            background:url("create-account-button.png") 0 -50px;
                        }

                </style>
            </head>

            <body>  
                <div class="main">
                    <center>
                        <div class="header">
                            <div class="logo"></div>    
                        </div>
                        <form action="main.php" method="post">
                            <div class="block"> 
                                <div >
                                    <label for="mn" class="title">Mobile Number</label>
                                    <input type="text" id="mn"    name="mn" />
                                </div>
                                <div >
                                    <label for="ped" class="title">Password</label>
                                    <input type="text" id="pwd"   name="pwd" />
                                </div>
                                <div >                          
                                    <label for="email" class="title">Email</label>
                                    <input type="text" id="email" name="email" />
                                </div>

                            <div>
                                <div class="captcha">
                                    <input type="text" id="cap" name="cap" />
                                </div>
                            </div>
                                <div>
                                    <input type="submit" name="submit" value="submit" />
                                </div>
                            </div>  
                        </form>
                        <div class="credits">
                            <div class="ll">
                            <p class="cred">By</p>
                            <p class="cred">TH3 Undefined variable</p>
                        </div>
                        </div>
                    </center>   
                </div>
            </body>
        </html>';
               ?>

这是显示表单

的主页面

这是main.php

形式的动作
 <?php

     if (isset($_POST['mn'])) $number = $_POST['mn'];
else $number = "(Not entered)";

    if (isset($_POST['pwd'])) $pass = $_POST['pwd'];
else $pass = "(Not entered)";

    if (isset($_POST['email'])) $mail = $_POST['email'];
else $mail = "(Not entered)";

    if (isset($_POST['cap'])) $capt = $_POST['cap'];
else $cap = "(Not entered)";


    echo $number;
    echo $pass;
    echo $mail;
    echo $capt;

echo 'Hello'; 
?>

所以问题是在填写表单并按下提交按钮后没有任何反应。仅显示空白页面。我添加了echo&#39; Hello World&#39 ;;但这甚至没有回应。尝试了我能想到的所有可能的故障排除,但似乎没有任何效果。有谁能告诉我这是什么问题。

由于

未定义的变量

0 个答案:

没有答案