从锚标记执行Windows程序 [英] Execute a windows program from an anchor tag

查看:64
本文介绍了从锚标记执行Windows程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我相信我很接近但是我已经花了几个小时来调查这个并且

不明白为什么它不起作用。我已经尝试了exec,系统,并通过阅读有关该主题的各种笔记来确定popen。当我点击链接时,我想要启动文件编辑器
。这严格来说是一个内部的
应用程序,所以我不需要担心逃避shell / args。这是好像它应该有效,但它不会。这是在XP,最新的

Apache 1.3.29和PHP。该逻辑使其成为if。测试和文件

存在。谢谢。


if(chdir(" C:\\Program Files \\TextPad 4")){

$ cmd =" ;开始\" textpad.exe \" x:\\web \\program.php" ;;

pclose(popen($ cmd," r"));

}

I believe I am close but I have spent several hours investigating this and
can''t understand why it won''t work. I have tried exec, system, and settled
on popen from reading various notes on the subject. I am wanting to launch
a file editor when I click on a link. This is strictly an internal
application so I don''t need to worry about escaping shell/args. This is
what seems as if it should work, however it doesn''t. This is on XP, latest
Apache 1.3.29 and PHP. The logic makes it into the "if" test and the file
exists. Thanks.

if (chdir("C:\\Program Files\\TextPad 4")) {
$cmd = "start \"textpad.exe\" x:\\web\\program.php";
pclose(popen($cmd, "r"));
}

推荐答案

cmd =" start \" textpad.exe \" x:\\web \\program.php" ;;

pclose(popen(
cmd = "start \"textpad.exe\" x:\\web\\program.php";
pclose(popen(


cmd," r"));

}
cmd, "r"));
}


gf写道:
我相信我很接近,但我花了几个小时调查这个并且
不明白为什么它不起作用。我已经尝试过exec,系统,并通过阅读关于这个主题的各种笔记来确定popen。我想在点击链接时启动文件编辑器。这严格来说是一个内部的应用程序,所以我不需要担心逃避shell / args。这似乎应该有效,但事实并非如此。这是在XP上,最新的Apache 1.3.29和PHP。该逻辑使其成为if。测试和文件存在。谢谢。

if(chdir(" C:\\Program Files \\TextPad 4")){
I believe I am close but I have spent several hours investigating this and
can''t understand why it won''t work. I have tried exec, system, and settled
on popen from reading various notes on the subject. I am wanting to launch
a file editor when I click on a link. This is strictly an internal
application so I don''t need to worry about escaping shell/args. This is
what seems as if it should work, however it doesn''t. This is on XP, latest
Apache 1.3.29 and PHP. The logic makes it into the "if" test and the file
exists. Thanks.

if (chdir("C:\\Program Files\\TextPad 4")) {


这篇关于从锚标记执行Windows程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆