如何在echo PHP中显示模式引导程序

时间:2018-11-14 15:35:14

标签: javascript php

关于标题,在调用时如果结果为负,如何获得视频引导程序

$name_error =

在我的注册表中

代码:

<?php
    include '../../connessione.php';
    $name = "";
    //$email = "";
    if (isset($_POST['submit'])) {
        $name = $connessione->real_escape_string($_POST['name']);
        //$email = $_POST['email'];
        //$password = $_POST['password'];

        $sql_u = "SELECT * FROM store_locator_category WHERE name='$name'";
        //$sql_e = "SELECT * FROM users WHERE email='$email'";
        $res_u = mysqli_query($connessione, $sql_u);
        //$res_e = mysqli_query($connessione, $sql_e);

        if (mysqli_num_rows($res_u) > 0) {
            $name_error = "<script type='text/javascript'>
                $('#centralModalSuccess').on('show.bs.modal');
            </script>";;  
        }//else if(mysqli_num_rows($res_e) > 0){
            //$email_error = "Sorry... email already taken";  
        //}
        else{
            $query = "INSERT INTO store_locator_category (name) 
                        VALUES ('$name')";
            $results = mysqli_query($connessione, $query);
            echo 'Saved!';
            exit();
        }
    }
?>

<?php if (isset($name_error)): ?>
<?php endif ?>
            <div class="col-md-4">
            <form method="post" action="registra_formato.php" class="text-center border border-light p-5">
            <p class="h4 mb-4">Aggiungi un Formato</p>
            <input type="text" required id="defaultSubscriptionFormPassword" placeholder="Esempio: 3x6" name="name" class="form-control mb-4" placeholder="Name">
            <input class="btn btn-default btn-rounded" data-toggle="modal" data-target="#centralModalSuccess" name="submit" type="submit" value="Aggiungi"><br>
<?php if (isset($name_error)): ?>
            <span><?php echo $name_error; ?></span>
<?php endif ?>
            </form>
            </div>
<!-- Central Modal Medium Success -->
<div class="modal fade" id="centralModalSuccess" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
  aria-hidden="true">
  <div class="modal-dialog modal-notify modal-success" role="document">
    <!--Content-->
    <div class="modal-content">
      <!--Header-->
      <div class="modal-header">
        <p class="heading lead">Modal Success</p>

        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true" class="white-text">&times;</span>
        </button>
      </div>

      <!--Body-->
      <div class="modal-body">
        <div class="text-center">
          <i class="fa fa-check fa-4x mb-3 animated rotateIn"></i>
          <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Impedit iusto nulla aperiam
            blanditiis ad consequatur in dolores culpa, dignissimos, eius non possimus fugiat.
            Esse ratione fuga, enim, ab officiis totam.</p>
        </div>
      </div>

      <!--Footer-->
      <div class="modal-footer justify-content-center">
        <a type="button" class="btn btn-primary">Get it now <i class="fa fa-diamond ml-1 white-text"></i></a>
        <a type="button" class="btn btn-outline-primary waves-effect" data-dismiss="modal">No, thanks</a>
      </div>
    </div>
    <!--/.Content-->
  </div>
</div>
<!-- Central Modal Medium Success-->

因为现在它不会记录相同的值,但是在屏幕上不会显示任何内容。

我试图将脚本插入必须退出消息但无所事事的变量中

0 个答案:

没有答案