首页 > 解决方案 > 点击提交按钮没有响应

问题描述

这是我的代码。当我点击提交时。什么都没发生。没有错误或任何东西......

<form method="post" action="signup.php">
            <div class="col-md-12">
                <input type="text" name="uid" value="<?php echo "U-".rand(1000,9999).rand(100,999);  ?>"   hidden>
                <div id="login" class="col-md-6 text-center"><span class="label label-default" id="inputlab">User Type</span>
                    <select id="selectlog" name="utype" required>
                        <optgroup label="Select user type">
                            <option value="student" selected>Student</option>
                            <option value="teacher">Teacher</option>
                            <option value="parent">Parent</option>
                        </optgroup>
                    </select>

                </div>
                <div id="login" class="col-md-6 text-center"><span class="label label-default" id="inputlab">School Level</span>
                    <select class="form-control" name="ulevel" autofocus="" required>
                                        <optgroup label="SchoolLevel">
                                            <option value="PrePrimaryEducatiuon" selected>PrePrimary Education</option>
                                            <option value="PrimaryEducation">Primary Education</option>
                                            <option value="SecondaryEducation">Secondary Education</option>
                                        </optgroup>
                    </select>
                </div>
                <div id="" class="col-md-12 text-center">
                </div>
                <div id="login" class="col-md-6 text-center"><span class="label label-default" id="inputlab">First Name</span>
                    <input type="text" placeholder="enter first name..." id="inputlog" name="fname" required>
                </div>
                <div id="login" class="col-md-6 text-center" hidden><span class="label label-default" id="inputlab">Middle Name</span>
                    <input type="text" placeholder="enter middle name..." id="inputlog" name="mname" required>
                </div>
                <div id="login" class="col-md-6 text-center"><span class="label label-default" id="inputlab">Last Name</span>
                    <input type="text" placeholder="enter last name..." id="inputlog" name="lname" required>
                </div>
                <div id="login" class="col-md-6 text-center"><span class="label label-default" id="inputlab">Email address</span>
                    <input type="email" placeholder="enter your email..." id="inputlog" name="umail" required>
                </div>
                <div id="login" class="col-md-6 text-center"><span class="label label-default" id="inputlab">Phone Number</span>
                    <input type="tel" placeholder="enter phone number..." id="inputlog" name="uphone" required>
                </div>
                <div id="login" class="col-md-6 text-center"><span class="label label-default" id="inputlab">Name of School</span>
                    <input type="text" placeholder="enter your school name..." id="inputlog" name="uschool" required>
                </div>
                    <div id="" class="col-md-12 text-center">
                </div>
                <div id="login" class="col-md-6 text-center"><span class="label label-default" id="inputlab">Choose Password</span>
                    <input type="password" placeholder="enter preferred password..." id="inputlog" name="upass" required>
                </div>
                <div id="login" class="col-md-6 text-center" ><span class="label label-default" id="inputlab">Confirm Password</span>
                    <input type="password" placeholder="confirm password..." id="inputlog" name="upass2" required>
                </div>

                <div id="login" class="text-center col-md-12">
                    <button class="btn btn-info" type="submit" id="loginbtn" name="signup"><strong>SignUp</strong></button>
                    <p>Already have an account? <a class="text-danger" href="login.php"><strong> Login</strong></a></p>
                </div>
            </div>
            </form>

标签: phphtml

解决方案


你的 signup.php 可以访问吗?这个方法是否接受 POST 请求?在此处检查双引号:

value="<?php echo " U-".rand(1000,9999).rand(100,999); ?>"

推荐阅读