dsfdsf23423 2015-05-21 14:36
浏览 31

Bootstrap 3:使用Modal发布到php

I'm relatively new to php and Bootstrap and i am trying to use a modal to register and add a new user to my database but the information does not seem to be getting posted to the php side. please help me. The following is the registration modal:

                <form class = "form-horizontal" action="index.php" method="post"> 
                    <div class = "modal-header">
                    </div>
                    <div class = "modal-body">
                        <div class = "form-group" >
                            <label for = "user-name" class = "col-lg-2 control-lable">UserName:</label>
                            <div class = "col-lg-10">
                                <input type = "text" class ="form-control" id = "user-name" placeholder = "Username ">
                            </div>
                        </div>

                        <div class = "form-group" >
                            <label for = "password" class = "col-lg-2 control-lable">Password:</label>
                            <div class = "col-lg-10">
                                <input type = "password" class ="form-control" id = "password" placeholder = "Password">
                            </div>
                        </div>  

                        <div class = "form-group" >
                            <label for = "firstname" class = "col-lg-2 control-lable">FirstName:</label>
                            <div class = "col-lg-10">
                                <input type = "text" class ="form-control" id = "firstname" placeholder = "First Name">
                            </div>
                        </div>    

                        <div class = "form-group" >
                            <label for = "othername" class = "col-lg-2 control-lable">OtherName:</label>
                            <div class = "col-lg-10">
                                <input type = "text" class ="form-control" id = "othername" placeholder = "Other Name (If Any)">
                            </div>
                        </div> 

                        <div class = "form-group" >
                            <label for = "lastname" class = "col-lg-2 control-lable">LastName:</label>
                            <div class = "col-lg-10">
                                <input type = "text" class ="form-control" id = "lastname" placeholder = "Last Name">
                            </div>
                        </div>

                        <div class = "form-group" >
                            <label for = "alias" class = "col-lg-2 control-lable">Alias:</label>
                            <div class = "col-lg-10">
                                <input type = "text" class ="form-control" id = "alias" placeholder = "Your Alias">
                            </div>
                        </div>   

                        <div class = "form-group" >
                            <label for = "email" class = "col-lg-2 control-lable">Email:</label>
                            <div class = "col-lg-10">
                                <input type = "text" class ="form-control" id = "email" placeholder = "someone@example.com">
                            </div>
                        </div>

                        <div class = "form-group" >
                            <label for = "city" class = "col-lg-2 control-lable">City:</label>
                            <div class = "col-lg-10">
                                <input type = "text" class ="form-control" id = "city" placeholder = "City">
                            </div>
                        </div>

                        <div class = "form-group" >
                            <label for = "ecountry" class = "col-lg-2 control-lable">Country:</label>
                            <div class = "col-lg-10">
                                <select name = "country" id= "country" >
                                    <option value="Yemen" title="Yemen">Yemen</option>
                                    <option value="Zambia" title="Zambia">Zambia</option>
                                    <option value="Zimbabwe" title="Zimbabwe">Zimbabwe</option>
                                </select>
                            </div>
                        </div>

                    </div>
                    <div class = "modal-footer">
                        <div class = "form-group" >
                        <input class = "btn btn-danger" type = "submit" name = "register" value = "Register">
                        <a class = "btn btn-default" data-dismiss = "modal">Cancel</a>
                    </div>
                    </div>
                    </form>
            </div>
        </div>
    </div>
  • 写回答

1条回答 默认 最新

  • dongwen7283 2015-05-22 13:40
    关注

    Please check in console log after clicking the button is it throwing any error or what..If the form is submitted it will be posted to 'action="index.php"' .

    Where you are writing the user insertion code?

    in index.php just check by printing all the post values like below,u will come to know form is posted or not,

    if(isset($_POST)) {
     var_dump($_POST); exit;
    }

    </div>
    
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度