Home > Backend Development > PHP Tutorial > javascript中调用php文件不成功

javascript中调用php文件不成功

WBOY
Release: 2016-06-13 13:37:27
Original
1009 people have browsed it

javascript中调用php文件不成功,求助
环境为在linux下
javascript中的代码

$('#send').click(function() {
  $.get('send.php', {
  });
});

send 是我一个button的ID,需要点击这个button调用send.php。


send.php中的代码
$send = $_GET['send'];
if (isset($send)) {
  $r = exec("./copy");
  echo $r;


copy是一个简单的C文件,已经在linux下gcc -o出来测试过了,肯定没问题的


但是我点击button无法触发copy,求原因。

------解决方案--------------------
你不是没有传递 send 参数吗?
------解决方案--------------------
楼主用firebug看看。
------解决方案--------------------

JScript code

//这样试试
$('#send').live("click",function() {
  send = $('#mes').val();
  $.get('send22.php', {
    send : send
  }, function(data) {
    alert("send ok");
  });
}); <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template