我想用 php 调用 火狐打开一个网页面在cmd:执行 "d:\Program Files\Mozilla Firefox\firefox.exe" http://localhost/ppp.html 这个是可以使用的。我想用 php 调用它。<?php
exec("d:/Program Files/Mozilla Firefox/firefox.exe http://localhost/ppp.html");
?>这个代码不起作用,我想请问,得怎么处理?是权限问题?还是安全问题,要怎么设置??问题解决,有多少分给多少分。
exec("d:/Program Files/Mozilla Firefox/firefox.exe http://localhost/ppp.html");
?>这个代码不起作用,我想请问,得怎么处理?是权限问题?还是安全问题,要怎么设置??问题解决,有多少分给多少分。
解决方案 »
- 网站备份下来的数据库太大,如何导入?phpadmin限制2m
- [求助]制作搜索功能时出现问题
- 如何让程序后台在服务器上每隔五分钟生成一次一个静态页面
- CLI的PHP代码如何加密呢?~~~~~~~~ 在线等~~~~~
- 《晨晖学生分数查询系统》免费下载说明。
- 什么意思:$text=preg_replace("/\[h1\](.+?)\[\/h1\]/is","<h1>\\1</h1>",$text);
- sky_blue (老衲) 请进!
- PHP中是否能够记录用户Socket
- js中Array对象疑问
- php中 为什么验证码 必须要开启 ob_clean 才可以显示
- count统计后的排序问题
- form批量提交
string exec ( string $command [, array &$output [, int &$return_var ]] )第一个参数 The command that will be executed. 第一个是参数是cmd命令
如果是基于cli的,或许还有一线希望。
这个不行
php 的 exec、system等函数都是在后台运行的,不可能出现窗口界面另外php是在服务器上运行的,虽然你是在一台机器上调试,但也应该把它看做是两台机器
即便用exec能够出现窗口,你也不可能跑到服务器上去操作。
控制面板 > 管理工具 > 服务 > 找到apache > 右键属性 > 登录 > 允许服务与桌面交互打上勾
Set ws = CreateObject("wscript.shell")
ws.Run("http://目标页面.php")
WScript.Sleep 2000
For Each task in oword.Tasks
If InStr(task.name, "页面title") Then ok = "a"
Next
If ok <> "a" Then ws.Run("http://www.baidu.com")
oWord.Quit
Set oword = Nothing
Set ws = Nothing
再编写php执行页面:<html>
<head>
<title>页面title</title>
</head>
<body>
<?php
//$thisday = date("ymd", strtotime("-1 day"));
$thisday = date("Ymd");
system("cmd /c D:/path/backup/mysqldump -h localhost -u用户名 -p密码 数据库名>\"D:/path/dbbakup/保存的数据库文件名_".$thisday.".sql\"");
?>
</body>
<script language="javascript">
<!--
function clock(){i=i-1
window.opener = null;
window.open("","_self");
if(i>0)setTimeout("clock();",1000);
else self.close();}
var i=10
clock();
//-->
</script>
</html>
最后将*.vbs文件用windows的计划任务来调用。