duanliu6083 2017-04-25 03:14
浏览 157

表单提交时使用BlockUI.js

I write PHP to exec some system command in my Ubutu server. It should be waiting a period and and this time I want show loader waiting. Now, I exec directly, and not use ajax. How can I show show loader during form submit and hide loader when it dones?

Here is my php code:

 <?php
 if(isset($_POST['check_ip']))
 {
     $ip = "localhost";
     $user = 'root';
     $pass = 'letmein';
     $connection =  ssh2_connect($ip, 22);
     ssh2_auth_password($connection,$user,$pass);
     $stream = ssh2_exec($connection, 'ifconfig');
     stream_set_blocking($stream, true);    
     print "<pre>".stream_get_contents($stream)."</pre>";
     exit;
 }
?>

And form HTML:

 <div class="col-md-3">
   <div class="form-group">
      <label style='font-size:15px;color:black'>SHOW IP</label>
      <button name="check_ip" type="submit" id="check_ip" class="btn btn-primary btn-fill pull-center" onclick="return confirm('RELLY?')"><b>SHOW IP<b></button>    
   </div>
</div>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信小程序协议怎么写
    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看