数据未通过php格式

时间:2017-03-31 16:08:05

标签: php

这是代码,请帮助我,我连接到数据库

所以我使用mysqli_real_escape_string来获取清晰的数据并将其保存到我的表中但它在我的数据中没有任何内容

<?php 
$db_connect = mysqli_connect("localhost", "root", "", "master_wn");
if(isset($_POST['send']))
{
    session_start();
    $name   = mysqli_real_escape_string($_POST['name']);
    $name2  = mysqli_real_escape_string($_POST['name2']);
    $email  = mysqli_real_escape_string($_POST['email']);
    $case   = mysqli_real_escape_string($_POST['case']);
    $phone  = mysqli_real_escape_string($_POST['phone']);
    $adress = mysqli_real_escape_string($_POST['adress']);
    $sex    = mysqli_real_escape_string($_POST['sex']);
    $prove  = mysqli_real_escape_string($_POST['prove']);
    $quali  = mysqli_real_escape_string($_POST['quali']);
    $exper  = mysql_real_escape_string($_POST['exper']);


    $query = "INSERT INTO `stu_data` (`number`,`name`,`name2`,`email`,`phone`,`address`,`sex`,`cases`,`prove`,`quali`,`exper`) VALUES ('','$name','$name2','$email','$phone','$adress','$sex','$case','$prove','$quali','$exper')";
$q = mysqli_query($db_connect,$query);
if ($q){

        header("location:step2.php"); 
    }
    else 
    {
        "try again";
    }
}
 ?>

<html>
    <head>
        <title>
            test
        </title>
        <meta charset="utf-8">
        <link rel="stylesheet" href="../css/bootstrap.min.css"/>
        <link rel="stylesheet" href="../css/normliaze.css"/>
        <link rel="stylesheet" href="../css/style.css"/>
    </head>
    <body>
        <div>
        <div class="global">
       <!--Star Header-->
        <div class="header">

            <div class="boy">
                <h1>خطوات التقديم لحجز مقعد للدراسات العليا</h1>
                <img src="../images/logo.PNG" alt="logo" width="90" height="80">

                <p>موقع التقديم للدراسات العليا</p>


            </div>
        </div>
       <!--End Header-->
        <div class="holdForm">
<div class="container">

    <form class="well form-horizontal" action="step1.php" method="post"  id="contact_form">
<fieldset>

<!-- Form Name -->
<legend>الخطوة الاولي </legend>

<!-- Text input-->

<div class="form-group">
  <label class="col-md-4 control-label">Name</label>  
  <div class="col-md-4 inputGroupContainer">
  <div class="input-group">
  <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
  <input   placeholder="Name" class="form-control"  type="text" name = "name">
    </div>
  </div>
</div>

<!-- Text input-->

<div class="form-group">
  <label class="col-md-4 control-label" >الاسم</label> 
    <div class="col-md-4 inputGroupContainer">
    <div class="input-group">
  <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
  <input  placeholder="الاسم بالعربي" class="form-control"  type="text"  name="name2">
    </div>
  </div>
</div>

<!-- Text input-->
       <div class="form-group">
  <label class="col-md-4 control-label">E-Mail</label>  
    <div class="col-md-4 inputGroupContainer">
    <div class="input-group">
        <span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
  <input  placeholder="E-Mail Address" class="form-control"  type="text"  name="email">
    </div>
  </div>
</div>

<!-- radio checks -->
 <div class="form-group">
                        <label class="col-md-4 control-label">الحالة الاجتماعية</label>
                        <div class="col-md-4">
                            <div class="radio">
                                <label>
                                    <input type="radio" name="case" value="marig" /> متزوج
                                </label>
                            </div>
                            <div class="radio">
                                <label>
                                    <input type="radio" name="case" value="single" /> اعزب
                                </label>
                            </div>
                            <div class="radio">
                                <label>
                                    <input type="radio" name="case" value="widow" /> ارمل
                                </label>
                            </div>
                        </div>
                    </div>

<!-- Text input-->

<div class="form-group">
  <label class="col-md-4 control-label">الهاتف</label>  
    <div class="col-md-4 inputGroupContainer">
    <div class="input-group">
        <span class="input-group-addon"><i class="glyphicon glyphicon-earphone"></i></span>
  <input  placeholder="(+249)555-1212" class="form-control" type="text"  name="phone">
    </div>
  </div>
</div>

<!-- Text input-->

<div class="form-group">
  <label class="col-md-4 control-label">السكن</label>  
    <div class="col-md-4 inputGroupContainer">
    <div class="input-group">
        <span class="input-group-addon"><i class="glyphicon glyphicon-home"></i></span>
  <input  placeholder="Address" class="form-control" type="text"  name="adress">
    </div>
  </div>
</div>




 <div class="form-group">
                        <label class="col-md-4 control-label">الجنس</label>
                        <div class="col-md-4">
                            <div class="radio">
                                <label>
                                    <input type="radio" name="sex" value="mail" /> ذكر
                                </label>
                            </div>
                            <div class="radio">
                                <label>
                                    <input type="radio" name="sex" value="fmail" /> اثتي
                                </label>
                            </div>
                        </div>
                    </div>

<!-- Text area -->
<div class="form-group">
  <label class="col-md-4 control-label">اثبات شخصية</label>  
    <div class="col-md-4 inputGroupContainer">
    <div class="input-group">
        <span class="input-group-addon"><i class="glyphicon glyphicon-file"></i></span>
  <input  placeholder="Address" class="form-control" type="text"  name="prove">
    </div>
  </div>
</div>

<div class="form-group"> 
  <label class="col-md-4 control-label">المؤهل العلمي</label>
    <div class="col-md-4 selectContainer">
    <div class="input-group">
        <span class="input-group-addon"><i class="glyphicon glyphicon-list"></i></span>
    <select  class="form-control selectpicker"  name="quali">
      <option value=" " >... اختر مؤهل</option>
      <option  name="select1">دبلوم عالي</option>
      <option  name="select2">بكلاريوس</option>
    </select>
  </div>
</div>
</div>

<div class="form-group">
  <label class="col-md-4 control-label">سنوات الخبرة</label>  
    <div class="col-md-4 inputGroupContainer">
    <div class="input-group">
        <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
  <input name="exper" placeholder="Address" class="form-control" type="text">
    </div>
  </div>
</div>
<!-- Success message -->
<div class="alert alert-success" role="alert" id="success_message">Success <i class="glyphicon glyphicon-thumbs-up"></i> Thanks for contacting us, we will get back to you shortly.</div>

<!-- Button -->
<div class="form-group">
  <label class="col-md-4 control-label"></label>
  <div class="col-md-4">
      <input type="submit" class="btn btn-warning glyphicon glyphicon-send" name="send" value="التالي" > 
  </div>
</div>

</fieldset>
</form>
</div>
    </div><!-- /.container -->
        </div>
<div id="footer">
<p class="p2">جميع الحقوق محفوظة للمبرمج محمد تاج الدين &copy; 2017-2018</p>
</div><!--end footer-->
</div><!--end all-->
       <!--End content-->
<script src="/js/bootstrap.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/plugin.js"></script>
    </body>
</html>

这是代码,请帮助我,我连接到数据库

所以我使用mysqli_real_escape_string来获取清晰的数据并将其保存到我的表中但是它在我的数据中没有给我这个代码请帮助我我连接到数据库

所以我使用mysqli_real_escape_string来获取清晰的数据并将其保存到我的表中但它在我的数据中没有任何内容

0 个答案:

没有答案