exec的问题
- PHP code
<!---ecms Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php$str = array();exec("p4 login ****", $str);print_r($str);?>
现在的问题是P4命令行登陆的时候,先输入p4 login,然后命令行提示Enter password:后,再输入相应密码就可以登陆。
直接用P4 login ****是非法的。
有什么解决方法?
——解决方案——————–
这类东西大前年我做C的时候问过(在dos中自动回车),答案给了很多,不过,一个没有好使的
—–
!本文来源gaodai.ma#com搞#代!码(网
搞gaodaima代码-解决方案——————–
当初有人说将回车后面的内容放到文件中然后再输入到当前命令,如:
commond xxxxx xxxx << a.txt