简体   繁体   English

我想在单击按钮时重定向到同一目录的下一页 -

[英]I want to redirect on next page on same directory on button click -

Hi here is my php code for registration, I want to redirect to next page of this registration process after clicking on NEXT button.嗨,这是我用于注册的 php 代码,我想在单击 NEXT 按钮后重定向到此注册过程的下一页。 Please let me know is there any solution or my mistakes i this code .请让我知道此代码是否有任何解决方案或我的错误。

<form role="form" action="poolersign.php" method="POST" enctype="multipart/form-data">
                           <div class="form-group" style="float:right;width:40%">
                             <label for="exampleInputEmail1">Last Name</label><span style="color:red"> *</span>
                             <input type="text" class="form-control" name="Lname" id="service_range"  placeholder="Enter Last Name">
                           </div>
                           <div class="form-group" style="float:left;width:40%">
                             <label for="exampleInputEmail1">First Name</label><span style="color:red"> *</span>
                                 <input type="text" class="form-control" name="Fname" id="shop_name" placeholder="Enter First Name">
                           </div>
                           <div class="form-group" style="float:right;width:40%">
                              <label for="exampleInputEmail1">Home Address</label><span style="color:red"> *</span>
                              <textarea class="form-control" name="Home_address" id="full_address" placeholder="Home Address" cols="20" rows="2"></textarea>
                               </div>
                           <div class="form-group" style="float:left;width:40%">
                               <label for="exampleInputEmail1">Office Address</label><span style="color:red"> *</span>
                               <textarea class="form-control" name="Office_address" id="full_address" placeholder="Office Address" cols="20" rows="2"></textarea>
                               </div>
                               <div class="form-group" style="float:right;width:40%">
                              <label for="exampleInputEmail1">Pincode</label><span style="color:red"> *</span>
                              <input type="text" class="form-control" name="hpincode" id="person_name" placeholder="Enter pincode of home address">
                          </div>
                              <div class="form-group" style="float:left;width:40%">
                              <label for="exampleInputEmail1">Pincode</label><span style="color:red"> *</span>
                              <input type="text" class="form-control" name="opincode" id="pincode" placeholder="Enter pincode of office address">
                          </div>
                          <div class="form-group" style="float:right;width:40%">
                              <label for="exampleInputEmail1">ID Card Number</label><span style="color:red"> *</span>
                              <input type="text" class="form-control" name="idcard_number" placeholder="Enter ID Card Number">
                         </div>
                        <div class="form-group" style="float:left;width:40%">
                              <label for="exampleInputEmail1">Mobile Number</label><span style="color:red"> *</span>
                              <input type="text" class="form-control" name="mobile_number" id="tin_number" placeholder="Enter Mobile Number">
                            </div>
                        <div class="form-group" style="float:left;width:40%">
                              <label for="exampleInputEmail1">Email</label><span style="color:red"> *</span>
                              <input type="email" class="form-control" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" name="email" id="email" placeholder="Enter email">
                           </div>
                           <div class="form-group" style="float:right;width:40%">
                              <label for="exampleInputEmail1">Enter Username</label><span style="color:red"> *</span>
                              <input type="text" class="form-control" name="username" id="full_address" placeholder="Enter Username" >
                           </div>
                           <div class="form-group" style="float:left;width:40%">
                              <label for="exampleInputEmail1">Enter Password</label><span style="color:red"> *</span>
                              <input type="Password" class="form-control" name="password" id="password" placeholder="Enter Password">
                           </div>
                           <div class="form-group" style="float:right;width:40%">
                              <label for="exampleInputEmail1">Confirm Password</label><span style="color:red"> *</span>
                              <input type="Password" class="form-control" name="confirm" id="confirm" placeholder="Confirm Password">
                           </div>
                           <div class="form-group" style="float:left;width:40%">
                            Gender &nbsp;&nbsp;
                              <input type="radio"  name="gender"  value="female" checked> Female
                              <input type="radio"  name="gender"  value="male">Male
                          </div>    
                          <div class="clearfix">&nbsp;</div>
                           <div class="form-group" style="width:100%">
                            **<center><div style="float:left;width:80%"><button type="submit" id="postJson" name="add_store" class="btn btn-success"/> Next</button> &nbsp;&nbsp;
                            <button type="reset"   class="btn btn-success"/>Reset</button></div></center>**
                          </div>
                          </form>
                          <?php include("admin/save_store.php"); ?>
                        </div>
                    </div>
                        <div class="col-md-4 col-md-offset-0.5">
                        </form>
                    </div>
        </div>
        <!--/ADD POOLER -->
    </div>  
    <?php
        include("config/conn.php");
    $Error ="";
    $successMessage ="";
    //if (isset($_POST['add_store'])){

            if(!empty($_POST['Home_addresss']) && !empty($_POST['Fname']) && !empty($_POST['Office_address']) && !empty($_POST['username']) && !empty($_POST['Lname'])&& !empty($_POST['mobile_number']) && !empty($_POST['hpincode']) && !empty($_POST['mobile_number']) && !empty($_POST['email']) && !empty($_POST['opincode']) && !empty($_POST['password']) && !empty($_POST['confirm'])&& !empty($_POST['idcard_number']))
    {
              $unm=$_POST['username'];
      $email=$_POST['email'];
              $res=$conn->query("select * from poolreg where shop_name='$unm' or email='$email'")or die(mysql_error());

             if($res->num_rows  > 0)
           {
                 echo "Username already exist!!";
                 //$Error="Shop Name already Exist!";

           }
             else
           {

                if($_POST['password']==$_POST['confirm'])
                {
                        //$area_address=$_POST['area_address'];
                        //$setting_latitude=$_POST['setting_latitude'];
                        //$setting_longitude=$_POST['setting_longitude'];
                        $service_range=$_POST['Lname'];
                        $shop_name=$_POST['Fname'];
                        //$shop_number=$_POST['shop_number'];
                        $Home_address=$_POST['Home_address'];
                        $Office_address=$_POST['Office_address'];
                        $hpincode=$_POST['hpincode'];
                        $opincode=$_POST['opincode'];
                        $mobile_number=$_POST['mobile_number'];
                    //$description=$_POST['description'];
                        $idcard_number=$_POST['idcard_number'];
                        $username=$_POST['username'];
                        $gender=$_POST['gender'];
                        /*$mobilewhatsup=$_POST['mobilewhatsup'];   
                        $other_number=$_POST['other_number'];
                        $otherwhatsup=$_POST['otherwhatsup'];   */
                        $email=$_POST['email'];
                        $passwd=strrev($_POST['password']);
                        $password=md5($passwd);
                        $date=md5(date("Y-m-d "));
                        $time=md5(date("h:i:sa"));
                        $rand=rand(0,999);
                        $date="shop_".substr($shop_name,0,3).substr($date,0,3).substr($time,0,3);   
                        $sql = "insert into poolreg(Lname,Fname,Officeaddr,Homeaddr,Officepincode,Homepincode,mobile,IDcardnumber,email,username,password,gender)values('$service_range','$shop_name','$Office_address','$Home_address','$opincode','$hpincode','$mobile_number','$idcard_number','$email','$username','$password','$gender')";
                        **if ($conn->query($sql) === TRUE) 
                        {
                            header("Location: poolersign1.php");                                             
                        }** 
                        else 
                        {
                                echo "Error in adding Current Record!!!!";
                                //$Error="Error in adding Current Record!";
                        }

                }
                    else
                          {
                            echo "Password doesnt match!!!!!";
                            //$Error="Password Not Match";
                                  }

           }
    }
    else
    {

           echo "Fill the required Fields!!!!";
           //$Error="Fill The Required Fields!";

    }

//} //}

if all the fields are fill-up correctly on this page it should redirect to poolersign1.php for next process.如果此页面上的所有字段都正确填写,则应重定向到 poolersign1.php 以进行下一个过程。 You can see live here wepooldemo.welfare678advertisement.com/poolersign.php你可以在这里看到直播 wepooldemo.welfare678advertisement.com/poolersign.php

You will have to write code in your poolersign.php.您必须在 poolersign.php 中编写代码。 You can use header("Location: ") function.您可以使用 header("Location:") 函数。

You have make some mistake trying to replace code :您在尝试替换代码时犯了一些错误:
From:从:

if(!empty($_POST['Home_addresss']) && !empty($_POST['Fname']) && !empty($_POST['Office_address']) && !empty($_POST['username']) && !empty($_POST['Lname'])&& !empty($_POST['mobile_number']) && !empty($_POST['hpincode']) && !empty($_POST['mobile_number']) && !empty($_POST['email']) && !empty($_POST['opincode']) && !empty($_POST['password']) && !empty($_POST['confirm'])&& !empty($_POST['idcard_number']))

to:到:

  if(!empty($_POST['Home_address']) && !empty($_POST['Fname']) && !empty($_POST['Office_address']) && !empty($_POST['username']) && !empty($_POST['Lname'])&& !empty($_POST['mobile_number']) && !empty($_POST['hpincode']) && !empty($_POST['mobile_number']) && !empty($_POST['email']) && !empty($_POST['opincode']) && !empty($_POST['password']) && !empty($_POST['confirm'])&& !empty($_POST['idcard_number']))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我想重定向到一个网站,然后单击它上的一个按钮 - I want to redirect to a website and then click on a button on it 调用 API 并使用相同的点击 ReactJS 重定向到下一页 - Call API and redirect to next page with same click ReactJS 我开发了一个api,我希望它重定向到其他php页面,并在我单击api文件中的按钮时弹出模式 - I developed a api and i want it to redirect to other php page and pop up the modal as i click the button in api file 当我单击注销按钮时,会打开确认警报。 当我取消时,它将重定向登录页面,但我想重定向当前页面。 我该怎么做? - When i click in logout button open a confirm alert. When i cancel it will redirect login page but i want to redirect current page. How i can do it? jQuery单击按钮,在同一页面上重定向,但重定向到其他部分/面板 - jQuery on button click, redirect on the same page but to a different section/panel 重定向到同一目录中的页面 - Javascript - Redirect to a page in same directory - Javascript 点击“离开此页面”按钮上的重定向 - Redirect on “Leave this Page” button click 为什么当我点击下一页时,编辑或删除按钮不起作用? - Why when I click on the next page the button edit or delete is not working? 当我单击 gliderjs 中的下一个/上一个按钮时,页面 go 到顶部 - Page go to top when i click on next/prev button in gliderjs 在单击上一个/下一个按钮时,我要突出显示下一个或上一个图像 - On click previous/next button, I want to highlight the image which is next or prev
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM