我在Windows控制台中运行我的php脚本,使用CMD并编写:
[PATH to php.ext]\php.exe [path_to_file]\file.php parameter
有没有办法运行带有GUI(或类似的)的php文件,并输入文本以便在不使用浏览器的情况下询问参数?像这样:
谢谢你们。
答案 0 :(得分:0)
Visual Basic脚本对我来说是一个有效的选项:
sub shell(cmd)
' Run a command as if you were running from the command line
dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run(cmd)
Set objShell = Nothing
end sub
dim name
' Ask the user for a parameter
name = inputbox("Parameter", "Title", "")
if name <> "" then
' The user gave the parameter. Open the program
' with the value the user gave.
shell "php.exe file.php " & name
else
msgbox "User cancelled.", 16, "User cancelled"
end if