简体   繁体   English

如何通过手机连接在本地计算机屏幕上打开php弹出消息?

[英]How to open php popup message on localhost computer screen via mobile phone connection?

There is apache server installed on my localhost computer (win7 system) with php. 我的本地主机计算机(win7系统)上安装了带有php的apache服务器。 c:\\apache is my localhost directory. c:\\ apache是​​我的本地主机目录。 I can connect to localhost with my mobile phone. 我可以用手机连接到本地主机。 I can reach the content of the localhost folder and run PHP files. 我可以到达localhost文件夹的内容并运行PHP文件。

I want to send a popup message to localhost computer screen via mobile phone connection. 我想通过手机连接向本地计算机屏幕发送弹出消息。

I tried to use a vbs script in php file and tried the following functions : 我试图在php文件中使用vbs脚本,并尝试了以下功能:

vbs file content set WshShell = WScript.CreateObject("WScript.Shell") WScript.Quit (WshShell.Popup( "My message here" ,10 ,"Warning", 64+4096)) vbs文件内容集WshShell = WScript.CreateObject(“ WScript.Shell”)WScript.Quit(WshShell.Popup(“此处我的消息”,10,“警告”,64 + 4096))

exec("message.vbs");
shell_exec("message.vbs")
system("message.vbs)
exec("start message.vbs")
exec("start warning.wav")  // It can be a sound message instead of text msg

VBS script works when I run it directly on the local computer but I can't run it from PHP file. 当我直接在本地计算机上运行VBS脚本时,它可以工作,但无法从PHP文件中运行它。

I hope it is clear enough. 我希望它足够清楚。

Did you tried this? 你有试过吗

exec('cmd %pathToVBSFile%');

I found this on php.net: 我在php.net上找到了这个:

 start MSPaint maximized and wait for you to close it before continuing the script: 

<?php 
$WshShell = new COM("WScript.Shell"); 
$oExec = $WshShell->Run("mspaint.exe", 3, true); 
?> 

Did you tried to execute something else than VBS from PHP? 您是否尝试过从PHP执行VBS以外的其他功能? You can try to convert the vbScript to a .exe with Vbs to Exe (maybe apache doesn't have the right to execute VBS) 您可以尝试将vbScript转换为.vbs到.exe的.exe (也许apache无权执行VBS)

I want to send a popup message to localhost computer screen via mobile phone connection. 我想通过手机连接向本地计算机屏幕发送弹出消息。 Win 7-8's msg.exe don't display popup message. 赢7-8的msg.exe不显示弹出消息。 I did it with windows XP msg.exe. 我是用Windows XP msg.exe完成的。 I carried xp's msg.exe to win 7-8's system32 folder. 我携带XP的msg.exe赢得7-8的system32文件夹。 It worked. 有效。
I added the following code to my php file test.php. 我将以下代码添加到我的php文件test.php中。 And when I run it from mobile phone, it sends a popup message on localhost computer screen. 当我从手机运行它时,它会在本地计算机屏幕上发送一条弹出消息。

http://192.168.1.102/test.php



<? msg username hello world ?> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM